swagger-tools
swagger-tools copied to clipboard
Duplicate operationId is not throwing errors
According to the Swagger 2.0 spec, regarding operationId
:
A friendly name for the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operation id to uniquely identify an operation.
However, a Swagger 2.0 spec with duplicate operationId
s is not throwing an error via swagger-tools.
Here's a sample spec to repro the issue:
{
"swagger": "2.0",
"info": {
"version": "0.0.0",
"title": "Simple API"
},
"paths": {
"/": {
"get": {
"operationId": "unoriginalOperationId",
"responses": {
"200": {
"description": "OK"
}
}
},
"post": {
"operationId": "unoriginalOperationId",
"responses": {
"200": {
"description": "OK"
}
}
}
}
}
}
Yup, I just filed a bug at the same time you did. I will close #220 as a duplicate of this one.
I had to reopen this since it broke backward compatibility. I will add this back when 1.0.0
is released.
any news on this bug ? this control on duplicate id is missing from a lot of swagger validators ... (except the one behind https://editor.swagger.io/)
This will not be released prior to 1.0.0
, which itself might not be released due to this project being effectively deprecated, see #335.