-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 support for @ResponseStatus and @ResponseHeader #20311
Conversation
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building ba2eeb8
Full information is available in the Build summary check run. Failures⚙️ Gradle Tests - JDK 11 Windows #- Failing: integration-tests/gradle
📦 integration-tests/gradle✖
|
@@ -432,6 +437,45 @@ public RuntimeResource buildResourceMethod(ResourceClass clazz, | |||
pathParameterIndexes, score, sseElementType, clazz.resourceExceptionMapper()); | |||
} | |||
|
|||
private void addResponseHandler(ServerResourceMethod method, List<ServerRestHandler> handlers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the new ResponseHandler.ResponseBuilderCustomizer
and PublisherResponseHandler.StreamingResponseCustomizer
integration classes?
Couldn't we just register a handler in HandlerChainCustomizer.Phase#AFTER_RESPONSE_CREATED
and use it to update the response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 reasons:
- we don't want to update the response if it is created by the user - a Response returned by the user always takes precedence over the annotations.
- In the case of streaming, there is no such phase. The streaming handler is essentially the last handler to be executed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For 1 we could add an extra check and forgo the use of the customizer, but it would also mean that the Response would be created again - so slightly more overhead.
I am also wondering if using |
Fixed conflict |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building f8b7d93
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 17 #- Failing: extensions/grpc/deployment
! Skipped: docs integration-tests/devmode integration-tests/grpc-health and 9 more 📦 extensions/grpc/deployment✖
|
@stuartwdouglas @FroMage what is your take on this one? |
I rebased the PR. I think this makes sense to have as it also affects Kotlin users who want to use |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 9b1b0a2
Failures⚙️ JVM Tests - JDK 17 #- Failing: extensions/hibernate-search-orm-elasticsearch/deployment
! Skipped: docs extensions/hibernate-search-orm-elasticsearch-aws/deployment integration-tests/hibernate-search-orm-elasticsearch and 1 more 📦 extensions/hibernate-search-orm-elasticsearch/deployment✖ |
...teasy-reactive/common/runtime/src/main/java/org/jboss/resteasy/reactive/ResponseHeaders.java
Outdated
Show resolved
Hide resolved
Closes: quarkusio#20100 Co-authored-by: Yelzhas Suleimenov <[email protected]>
Failing Jobs - Building d6aa606
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 11 #- Failing: integration-tests/kafka-sasl-elytron
📦 integration-tests/kafka-sasl-elytron✖
|
The failure is completely unrelated |
Closes: #20100
I took the tests from #20242 where @Yelzhasdev made a first attempt to implement the feature.