Open domanchi opened 5 years ago
My opinion is that we shouldn't be trying to work around invalid Swagger files. We've actually hit this before, but in that case the Swagger/OpenAPI maintainers just updated the examples to have a type
field. (see Yelp/bravado#416 and OAI/OpenAPI-Specification#1923)
I couldn't figure out where the source code for petstore.swagger.io
was before, but if it's open-source and you can find it, you can get free green boxes by submitting a PR to update the website :)
Reproduction Steps
Analysis
Looking at the issue, it looks like petstore's swagger specification doesn't specify it's types that it produces accurately.
Bravado then interprets this value literally, and tries to JSON decode it, thereby causing a JSON decode error.
After all, in practice, it only returns a string:
Action Steps
We need to decide whether we should accept this as "functioning by design", or whether we should work around this limitation, and modify our assumption that Swagger files are accurate.