-
Notifications
You must be signed in to change notification settings - Fork 59
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
Accidentally truncating fields generates invalid Swagger specifications #185
Comments
Right, swagger2/src/Data/Swagger/Internal/Schema.hs Lines 784 to 800 in eaf9fc9
You can see that is checks We could insert a check in there to see that it was Unfortunately there is no gentle way to handle warnings/errors in swagger2/src/Data/Swagger/Internal/Schema.hs Line 780 in eaf9fc9
Other errors are We could also expand @bitemyapp what would you expect to happen in your case?
Can you provide an example? |
https://github.com/bitemyapp/swagger2-empty-field-name-bug/blob/master/app/Main.hs
Now, I realize dropping too many characters is a user error, but there's absolutely no warning anywhere that you made a mistake and it generates Swagger that is rejected by editor.swagger.io
The error you get from the editor is:
items must be an object
It seems like it's handling an empty string poorly somewhere and it tricks it into thinking the object is an array when it should just blow up with an error. I don't entirely understand the Generics code so I cannot say for sure.
Another source of confusion is that it flattens nested types out in a way that makes a deeply nested type with this mistake bubble up to the root type.
The text was updated successfully, but these errors were encountered: