There are currently ways to add parameters to every path via Swashbuckle. Some such way can be found here.
Let's say I want to add a parameter to every path called 'api-version'. Then this parameter will appear in every path in the Swagger file.
I want Swashbuckle to generate a single global parameter. For example, instead of this
{
"swagger": "2.0",
"paths": {
"/something": {
"post": {
"operationId": "something_do",
"parameters": [
{
"name": "api-version",
"in": "query",
"description": "The API version.",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "Something got done.",
"schema": {
"type": "string"
}
}
}
}
}
}
}
, I want
{
"swagger": "2.0",
"paths": {
"/something": {
"post": {
"operationId": "something_do",
"responses": {
"200": {
"description": "Something got done.",
"schema": {
"type": "string"
}
}
}
}
}
},
"parameters": {
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"required": true,
"type": "string",
"description": "The API version."
}
}
}
with the parameter set globally, and not under every path. I'm unable to find anything under SwaggerGenOptions that produces this.