-
Notifications
You must be signed in to change notification settings - Fork 32
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
swagger-diff failed #48
Comments
Thank you for your report. Looking at the code, my best guess is that you have If that doesn't help, you may want to validate your Swagger specifications using Swagger's Validator Badge to confirm there are no errors. The validator isn't perfect, but it will catch most common errors. If that still doesn't identify any issues, it's hard to tell from the exception alone what might be wrong. If you are comfortable sharing your specifications, I would be happy to see if I can recreate the problem and identify the cause. Feel free to anonymize, obfuscate, or truncate the specification, as long as it's still valid; I only need a snippet that will allow me to recreate the problem, and not the full specification. |
I changed that "additionalProperties": {"type":"string"}, and now I am getting this error :
` I checked the json on swagger validator, which showed 2 error regarding formdata, I removed those 2 as well from the path of my json. After that I started getting this error. Any help / suggestion will be helpful. |
And moreover, why does it is not showing error on online swagger editor after correction, but the same json is giving error with local swagger-validator ? This json, I have not changed the additionalProperties pattern. |
My best guess based on that error is you have an array without an items hash. Per https://swagger.io/specification/, under Fixed Fields, an items hash is required when specifying an array type. Unfortunately, the Swagger specification isn't 100% machine validatable, so it's possible to run into these edge cases. I'm unfamiliar with the online Swagger editor you're referring to, so I can't speak as to its specific features or limitations. |
It's been a month, so I'm going to trust that adding an items hash resolved your problem and close this issue. If you encounter additional problems, please either comment on this issue or create a new issue as appropriate. Thanks again for your feedback! |
/var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:206:in
hash_property': undefined method[]' for true:TrueClass (NoMethodError) from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:223:in
block in properties'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:216:in
each' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:216:in
properties'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:136:in
schema' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:108:in
refs'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:162:in
nested' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:179:in
properties_for_ref'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:226:in
block in properties' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:216:in
each'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:216:in
properties' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:136:in
schema'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:108:in
refs' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:162:in
nested'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:179:in
properties_for_ref' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:226:in
block in properties'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:216:in
each' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:216:in
properties'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:136:in
schema' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:108:in
refs'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:133:in
schema' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:237:in
block in request_params_inner'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:235:in
each' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:235:in
request_params_inner'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:19:in
block in request_params' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:18:in
each'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/specification.rb:18:in
request_params' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/diff.rb:142:in
block in changed_request_params_enumerator'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/diff.rb:112:in
each' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/diff.rb:112:in
each'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/diff.rb:112:in
each' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/diff.rb:112:in
change_hash'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/diff.rb:130:in
new_or_changed_request_params' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/diff.rb:13:in
changes'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/diff.rb:48:in
changed_endpoints_message' from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/lib/swagger/diff/diff.rb:21:in
changes_message'from /var/lib/gems/2.1.0/gems/swagger-diff-1.1.0/exe/swagger-diff:40:in
<top (required)>' from /usr/local/bin/swagger-diff:23:in
load'from /usr/local/bin/swagger-diff:23:in
<main>
I am getting this error after I run a swagger-diff on 2 json. Can anyone help why it is crashing? How to find if something within my json is breaking it ?
I used swagger-diff -c old.json new.json
The text was updated successfully, but these errors were encountered: