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 ability to document response headers #119

Closed
awiddersheim opened this issue Jan 18, 2016 · 4 comments
Closed

Add ability to document response headers #119

awiddersheim opened this issue Jan 18, 2016 · 4 comments

Comments

@awiddersheim
Copy link
Contributor

The library has the ability to quickly document the expected request headers but currently there is not greay way to document the response headers. There was some stuff added in a2b73da to be able to do it but only with error handlers.

I was thinking the best place to do it would be in response().

Seems like it might be better to convert responses to a dict rather than a tuple which has to get unpacked and makes this a bit difficult.

Perhaps this is part of the todo planned:

https://github.com/noirbizarre/flask-restplus/blob/master/flask_restplus/swagger.py#L384

@noirbizarre
Copy link
Owner

Hum, you're right.

Seems to be the@api.header is redundant with adding a RequestParser header argument.
So maybe I should use @api.header for documenting response header instead a let RequestParser expose expected headers ?

@awiddersheim
Copy link
Contributor Author

Yeah, that makes sense to me as well. Pretty large breaking change though obviously.

@noirbizarre
Copy link
Owner

Yes, but not so big, @api.response was added late (0.8) and it's sole purpose is documenting, so it does not break the API behavoir, only the header documentation.

@noirbizarre noirbizarre added this to the 0.10 milestone Apr 21, 2016
@defat
Copy link

defat commented Jul 21, 2016

I'd suggest extending api.response with headers definition instead of using separate api.header decorator thus it gives possibility for returning different headers for different response statuses.

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

3 participants