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

Only generated response status code when statusCode > 0 #266

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

rob-bygrave
Copy link
Contributor

Support use case that requires programmatic control of status code but non-void controller method. This might be marginal but I don't think its a negative.

Support use case that requires programmatic control of status code but non-void controller method. This might be marginal but I don't think its a negative.
Copy link
Collaborator

@SentryMan SentryMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expecting a negative status code one of these days?

@rob-bygrave
Copy link
Contributor Author

rob-bygrave commented Aug 8, 2023

expecting a negative status code one of these days?

Not really. The use case is pretty marginal in that if folks need programmatic control over the statusCode then they can take complete control, use a method that takes the ServerResponse / Context, returns void ... and completely control how the response is written.

This prevents any extra response.setStatus(...) being generated if for some reason they want that control but actually still return a non-void response and get the generated code to write the response body.

Its very marginal yeah.

@rob-bygrave rob-bygrave merged commit 616c255 into master Aug 8, 2023
2 checks passed
@rob-bygrave rob-bygrave deleted the feature/inline-validLanguage branch August 8, 2023 04:13
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

Successfully merging this pull request may close these issues.

2 participants