Skip to content
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

Does not handle empty response case #122

Open
ccouzens opened this issue Aug 17, 2018 · 0 comments
Open

Does not handle empty response case #122

ccouzens opened this issue Aug 17, 2018 · 0 comments

Comments

@ccouzens
Copy link

From the swagger documentation:

Some responses, such as 204 No Content, have no body. To indicate the response body is empty, do not specify a content for the response:

https://swagger.io/docs/specification/describing-responses/#empty

If you try and test such an endpoint with apivore, you get the following exception:

Swagger doc: /swagger.json missing response model for get request with /liveness for code 200

It looks like the validator code https://github.com/westfieldlabs/apivore/blob/master/lib/apivore/validator.rb#L83 should be checking to see if response body is null before raising an exception about missing response models

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant