You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that validate_spec will fail on validating response codes when it is not wrapped with single quote. But on swagger website, response codes are not quoted: http://editor.swagger.io/#/
On OpenAPI doc, example response codes are wrapped with quotes.
I am confused which way is the correct and valid way to write response code in spec yaml. Can you make both type of response codes pass validation? Or is response code without quote not valid?
The text was updated successfully, but these errors were encountered:
The problem here is that JSON only allows strings as dictionary keys, and quite a bit of spec-handling code expects the response codes to be strings because of that. I've added handling of these integer response codes to bravado: https://github.com/Yelp/bravado/blob/master/bravado/swagger_model.py#L107
Unfortunately the Swagger spec does not explicitly define that response codes have to be strings, this was simply a limitation of JSON (and thus implicitly defined). With the advent of YAML spec this has changed. Note though that the YAML example within the spec does wrap the response code in quotes to make sure it's a string: http://swagger.io/specification/#responsesObject
I found that validate_spec will fail on validating response codes when it is not wrapped with single quote. But on swagger website, response codes are not quoted: http://editor.swagger.io/#/
On OpenAPI doc, example response codes are wrapped with quotes.
I am confused which way is the correct and valid way to write response code in spec yaml. Can you make both type of response codes pass validation? Or is response code without quote not valid?
The text was updated successfully, but these errors were encountered: