-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
When annotating an optional query parameter like
ENDPOINT_INFO(getEndpoint)
{
info->queryParams.add<String>("param").description =
"(optional) Query parameter";
info->queryParams.add<String>("param").required = false;
info->queryParams.add<String>("param").allowEmptyValue = true;
}
ENDPOINT("GET", "/test", getEndpoint, QUERIES(QueryParams, queryParams))
the parameter gets added three times to the OpenAPI spec at /api-docs/oas-3.0.0.json:
"parameters": [
{
"name": "param",
"description": "(optional) Query parameter",
"in": "query",
"required": false,
"deprecated": false,
"schema": {
"type": "string"
}
},
{
"name": "param",
"description": "(optional) Query parameter",
"in": "query",
"required": false,
"deprecated": false,
"schema": {
"type": "string"
}
},
{
"name": "param",
"description": "(optional) Query parameter",
"in": "query",
"required": false,
"deprecated": false,
"schema": {
"type": "string"
}
}
]
This interferes with some automated schema checks as for example used in https://github.com/openapi-generators/openapi-python-client, such that two of the three parameters need to be manually removed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels