Uh oh!
There was an error while loading. Please reload this page.
Do not force "" for http status code - #2147
Conversation
In JSON the key which is a number must be wrapped into "". This is not the case of yaml format. Different formats, different requirements. It does not make sense to force json requirements into yaml.
webron
commented
Feb 19, 2020
As a general rule, we're looking for compatibility between JSON and YAML representations of API definitions, and have added some restrictions in the spec to support it. Since in YAML keys are typed, the following is legal: responses:
"400": {...}400: {...}and doesn't really have a JSON equivalent. Even in YAML, that can cause parsing issues and we don't want to complicate parsing. The fact that Swagger Editor does not complain about it is an issue with the tool and should be filed there. |
pkuczynski
commented
Feb 19, 2020
This makes it really annoying to have to use |
webron
commented
Feb 19, 2020
I feel your pain (seriously). Regardless, this is definitely not a change we can do in 3.0.x because it changes the behavior of the spec. |
pkuczynski
commented
Feb 20, 2020
Well, I didnt know how to propose it for the next version? |
In JSON the key which is a number must be wrapped into "". This is not the case of yaml format. Different formats, different requirements. It does not make sense to force json requirements into yaml.
Please also note that https://editor.swagger.io does not wrap status codes into "", which is correct, but contradictory to this spec: