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

Reject multiple @HttpExchange declarations on the same element #32049

Closed
sbrannen opened this issue Jan 18, 2024 · 4 comments
Closed

Reject multiple @HttpExchange declarations on the same element #32049

sbrannen opened this issue Jan 18, 2024 · 4 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@sbrannen
Copy link
Member

Overview

While working on #31962, I noticed that we could potentially also log a warning for multiple @HttpExchange annotations declared on the same element (class or method); however, since it never makes sense to declare multiple @HttpExchange annotations on the same element, the team has decided to reject such declarations instead of merely logging a warning.

Related Issues

@sbrannen sbrannen added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Jan 18, 2024
@sbrannen sbrannen added this to the 6.1.4 milestone Jan 18, 2024
@sbrannen sbrannen self-assigned this Jan 18, 2024
@sbrannen
Copy link
Member Author

Commit b8b31ff only addressed server-side @HttpExchange support in controllers.

Reopening to address @HttpExchange support in HTTP interface clients.

@sbrannen sbrannen reopened this Jan 18, 2024
@injae-kim
Copy link
Contributor

Reopening to address @HttpExchange support in HTTP interface clients.

oh nice enhancement! If you don't start to working on above PR yet (apply rejecting multiple @HttpExchange on Http interface clients too), may I try to create PR? thanks!

I think I can create PR on this weekend 😃

@sbrannen
Copy link
Member Author

Thanks for the offer, @injae-kim, but the issue is assigned to me, and I am actively working on this.

@injae-kim
Copy link
Contributor

oh sorry for bothering you. I didn't know that you already working on this. thanks!!

sbrannen added a commit that referenced this issue Jan 19, 2024
…& WebFlux

This commit updates the RequestMappingHandlerMapping implementations in
Spring MVC and Spring WebFlux so that mixed @⁠RequestMapping and
@⁠HttpExchange declarations on the same element are rejected.

Note, however, that a @⁠Controller class which implements an interface
annotated with @⁠HttpExchange annotations can still inherit the
@⁠HttpExchange declarations from the interface or optionally override
them locally with @⁠HttpExchange or @⁠RequestMapping annotations.

See gh-31962
See gh-32049
Closes gh-32065
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants