-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValidationError: expected string or bytes-like object #35
Comments
The reason is that JSON doesn't accept any keys that are not strings. Your YAML contains integer keys in the form of response codes. Make them strings by quoting them and it will be fine. |
FWIW, this is documented in the readme - look for strict mode. |
Excuse me for my mistake, I should have read more, you are absolutely right |
No, it's all good, no need for excuses! Is there something about the documentation I could improve? |
I think isn't necessary. I followed the yaml code examples of Swagger/OpenApi and, how you say, they does not always match the JSON specs. Thank you so much for your attention. |
Would be nice to know file+line of validation error, if you have multiple files/big files it's hard to find it. Anyway your answer helped me, thx! |
I'm creating app with Flask, Connexion and Swagger. I want split swagger yaml file in multilpe files.
I have followed this reply:
spec-first/connexion#254 (comment)
When I execute my app appears the exception. This exception is raised by the function _validate_openapi_spec_validator on class BaseParser, line 235.
validate_v2_spec(self.specification)
specification is a dict.
This is the yaml with the reference:
And this is the yaml referenced:
The text was updated successfully, but these errors were encountered: