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

Pass flask Response objects straight through if returned by view functions #16

Closed
wants to merge 1 commit into from

Conversation

mjbryant
Copy link
Contributor

The test shows how this can be used to, say, override default Flask/werkzeug/rebar processing. Sometimes you just to control what gets returned, you know?

@mjbryant mjbryant added the enhancement New feature or request label Jul 24, 2018
@mjbryant mjbryant requested a review from tmlippman July 24, 2018 21:36
@mjbryant
Copy link
Contributor Author

As @tmlippman pointed out, I could have done this before, since rv is passed through if no marshal schema is defined. This wouldn't work if I wanted to define a marshal schema for one status code and not another, but that's a finer-grained use case that I don't care about for the moment.

@mjbryant mjbryant closed this Jul 24, 2018
@mjbryant mjbryant deleted the mbryant/flask-response-objects-bypass branch July 24, 2018 21:48
@barakalon
Copy link
Contributor

Yeah, I think the response handling is one of flask-rebar's biggest weaknesses at the moment - it doesn't adapt to atypical use cases very well.

I'd be super interested to hear ideas for improvement. An elegant solution for custom responses/content negotiation that plays well with swagger would be sweet.

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

Successfully merging this pull request may close these issues.

3 participants