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

Add response 400 implicitly (if the endpoint accepts anything) #5

Open
petrbel opened this issue Sep 6, 2018 · 4 comments
Open

Add response 400 implicitly (if the endpoint accepts anything) #5

petrbel opened this issue Sep 6, 2018 · 4 comments

Comments

@petrbel
Copy link
Member

petrbel commented Sep 6, 2018

No description provided.

@FloopCZ
Copy link
Contributor

FloopCZ commented Jan 17, 2019

@Teyras can you provide more information, please?

@janbuchar
Copy link
Collaborator

@FloopCZ yes - this is about the specification file (swagger.json). If an endpoint accepts any parameters (be it through the request body, path, query string, header...), there is a chance that the parameters will be invalid. Therefore, it might be reasonable to fill in the 400 response in the specification implicitly.

@janbuchar
Copy link
Collaborator

I'm still not sure about this. With today's Apistrap, it is possible to just add :raises InvalidFieldsError to the docblock and the response will be declared in the spec. Is it worth it to try to fill it in implicitly? @petrbel @blazekadam @FloopCZ

@janbuchar
Copy link
Collaborator

It's probably worth a try to think of all exceptions an endpoint can throw - not only InvalidFieldsError, but also stuff like Unauthorized or ForbiddenRequest.

@blazekadam blazekadam added this to the Release 1.0 milestone Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants