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

Improve Namespace.response decorator to handle HTTP/204 responses with no need to provide a Schema #25

Closed
frol opened this issue Sep 23, 2016 · 1 comment

Comments

@frol
Copy link
Owner

frol commented Sep 23, 2016

Currently, schema (model) is required for all non-error HTTP codes. There is no need to bother with models when HTTP/204 (No content) is going to be responded, so no model might be valid option in the Namespace.response decorator.

I would try to implement it as missing model, something along these lines, but you will need to change the latter code do expect None model:

- if model is None:
+ if model is None and code != 204:

As a subtask, it would be nice to find a place where HTTP/204 code is defined as constant (Flask or Werkzeug might have it).

/cc @khorolets

frol pushed a commit that referenced this issue Sep 24, 2016
* Refactor response decorator in namespace of flask_resplus_patched (#25)
* Add response(code=204) to delete in teams/resources.py (#26)
* Updated team delete test to expect 204 status instead of 200 (#26)
* Add constant for status code
@khorolets
Copy link
Collaborator

Isn't it done in #28?

@frol frol closed this as completed Sep 25, 2016
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

2 participants