我想让account
参数应用于所有路径,没有任何例外。有没有办法用 Swagger 2 做到这一点?我不想account
为每个路径应用参数。
{
"swagger": "2.0",
"info": {
"version": "1.0",
"title": "Doc"
},
"host": "localhost",
"schemes": [
"http"
],
"produces": [
"application/json"
],
"parameters": {
"account": {
"in": "header",
"name": "X-ACCOUNT",
"description": "Account id",
"type": "string",
"required": true
}
},
"paths": {
"/account": {
"get": {
"summary": "Get account",
"operationId": "getAccount",
"responses": {
"200": {
"description": "test"
}
}
}
},
..... other paths
}
}