我尝试更改json文件中的basePath,这似乎只更改了swagger-UI的底部"baseurl“。我想摆脱作为我的swagger-UI的一个组标题出现的“默认”。有没有人能够解决这个问题?我正在使用Swagger ~2.0。
发布于 2015-05-12 12:24:58
Default不是一个路径,它是一个标签。
在Swagger 2.0中,分组是使用标签完成的。可以将每个操作分配给零个或多个标签。在UI中,任何没有标记的操作都将在Default组下结束。
"/pet/findByStatus": {
"get": {
"tags": [
"pet"
],
"summary": "Finds Pets by status",
"description": "Multiple status values can be provided with comma seperated strings",
"operationId": "findPetsByStatus",
"consumes": [
"application/xml",
"application/json",
"multipart/form-data",
"application/x-www-form-urlencoded"
],
"produces": [
"application/xml",
"application/json"
],
"parameters": [
{
"name": "status",
"in": "query",
"description": "Status values that need to be considered for filter",
"required": false,
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi",
"default": "available",
"enum": [
"available",
"pending",
"sold"
]
}
],
"responses": {
"200": {
"description": "successful operation",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Pet"
}
}
},
"400": {
"description": "Invalid status value"
}
},
"security": [
{
"petstore_auth": [
"write:pets",
"read:pets"
]
}
]
}
}您可以看到,这些操作有一个值为"pet"的tags属性,该操作将在该标头下分组。
https://stackoverflow.com/questions/30174624
复制相似问题