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
using the yaml file from the swagger editor I saved it as a yaml file and tried to load it in the same way that the pyramid_swagger project loads the file. I get a "SwaggerValidationError: expected string or buffer" exception message. Debugging at that level shows that item passed down is an int not a string. Inspecting the dict that is generated from loading the file confirms that the response codes are rendered as integers. It is a rather nasty gotcha.
The text was updated successfully, but these errors were encountered:
the-destro
changed the title
Swagger Spec fails validation if response codes are not quoted
Swagger Yaml Spec fails validation if response codes are not quoted
Jan 12, 2017
In this case if your responseObject has no quote around 200 we cannot do anything fancy because yaml.load(f) reads it as an integer instead of string (expected type) and so the validation will fail.
using the yaml file from the swagger editor I saved it as a yaml file and tried to load it in the same way that the pyramid_swagger project loads the file. I get a "SwaggerValidationError: expected string or buffer" exception message. Debugging at that level shows that item passed down is an int not a string. Inspecting the dict that is generated from loading the file confirms that the response codes are rendered as integers. It is a rather nasty gotcha.
The text was updated successfully, but these errors were encountered: