【发布时间】:2019-08-23 17:46:49
【问题描述】:
我们使用 Swashbuckle 在我们的 .NET API(不是核心)上设置了 Swagger。
我正在寻找 LucyBot 以制作一个更好看的文档页面。查看他们的示例,他们的 OpenAPI 文件在根目录中有一个“标签”元素,用于将显示分成组。我们的(/swagger/docs/v1)没有这样的元素。我已经尝试过使用 SwaggerConfig.cs 中可以看到的所有内容,但没有运气。
有什么简单的方法可以自动生成这个吗?一些选项,或 cmets,或者我只是忽略的东西?
"swagger": "2.0",
"info": {
"description": "This is a demo of [LucyBot's API Documentation](http:\/\/lucybot.com) using swagger.io's Petstore server. You can find out more about Swagger at [http:\/\/swagger.io](http:\/\/swagger.io) or on [irc.freenode.net, #swagger](http:\/\/swagger.io\/irc\/). For this sample, you can use the api key `special-key` to test the authorization filters.\n\nTo use this documentation for your own API, visit [http:\/\/lucybot.com](http:\/\/lucybot.com)",
"version": "1.0.0",
"title": "Swagger Petstore",
"termsOfService": "http:\/\/swagger.io\/terms\/",
"contact": {
"email": "apiteam@swagger.io"
},
"license": {
"name": "Apache 2.0",
"url": "http:\/\/www.apache.org\/licenses\/LICENSE-2.0.html"
}
},
"host": "petstore.swagger.io",
"basePath": "\/v2",
"tags": [
{
"name": "pet",
"description": "Everything about your Pets",
"externalDocs": {
"description": "Find out more",
"url": "http:\/\/swagger.io"
}
},
{
"name": "store",
"description": "Access to Petstore orders"
},
{
"name": "user",
"description": "Operations about user",
"externalDocs": {
"description": "Find out more about our store",
"url": "http:\/\/swagger.io"
}
}
],```
【问题讨论】:
标签: swagger openapi swashbuckle