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
SwaggerValidationError: expected string or buffer #9
Comments
Thanks for the report! Yeah, I know a line number would be great. Ugh. I'll see what I can do about that. Do you have the file so I can reproduce? Or is that sensitive? You can email me directly at jens@finkhaeuser.de if you prefer. What OS are you using? Can you post the full stack trace? Thanks! |
So, line numbers are going to be difficult. I'm doing two steps here, a) is read the file into a Python data structure (nested dicts/lists, etc.), and b) to validate the structure via swagger_spec_validator. At the point you get a SwaggerValidationError, there are no more line numbers known. The best thing would be some kind of keyword context, but swagger_spec_validator does not provide that. I'm a little reluctant re-implementing this part... but let's see what else I can find. |
Right, a keyword would do just as fine. |
Thanks for this. The TL;DR is, I'm going to replace the validation backend. That solves your issue, another issue, and you should get better error messages in case there's something weird in your spec :) |
Took me a while to see the obvious: this is the same issue as #5. Still, if it crops up many times, let's still use a different backend. I've made it so people can use the old backend, so that should not cause any issues. |
0.8 should fix it. Otherwise, set strict = False :) |
I get this error trying to do:
The yaml file is valid according to editor.swagger.io and http://bigstickcarpet.com/swagger-parser/www/index.html
I have no idea where in the swagger file the error is. A line number or similar would be helpful
The text was updated successfully, but these errors were encountered: