【问题标题】:Where is the swagger json schema located?swagger json 模式在哪里?
【发布时间】:2018-04-08 02:20:24
【问题描述】:

help for swashbuckle 提到 Swagger 的 ui 是由生成的 json 架构驱动的。

这个 json 文件在哪里? 我在我的 asp.net 项目的文件夹中找不到它

当我实际运行应用程序并导航到 http://localhost:51659/swagger/v1/swagger.json

然后我看到了 json

它在磁盘上的什么位置?还是只存在于内存中?

【问题讨论】:

    标签: swagger swashbuckle


    【解决方案1】:

    没有生成文件,只在内存中。

    您可能想阅读一下代码: https://github.com/domaindrivendev/Swashbuckle/blob/master/Swashbuckle.Core/Swagger/SwaggerGenerator.cs

    如果您需要一个文件,您可以创建一个 IDocumentFilter 来生成一个。
    我这里有一个生成 Yaml 文件的示例:
    https://github.com/heldersepu/Swagger-Net-Test/blob/master/Swagger_Test/App_Start/SwaggerConfig.cs#L378

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-10-22
      • 1970-01-01
      • 1970-01-01
      • 2020-08-07
      • 2014-07-08
      • 2015-11-29
      相关资源
      最近更新 更多