Skip to content

@Nonnull annotation breaks ServletRequestMethodArgumentResolver for Principal #25981

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

Closed
rcaspar opened this issue Oct 28, 2020 · 2 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression
Milestone

Comments

@rcaspar
Copy link

rcaspar commented Oct 28, 2020

If you have something like:

@GetMapping("/foo")
public ResponseEntity<?> method(@Nonnull Principal principal) {
    return ResponseEntity.ok("bar");
}

ServletRequestMethodArgumentResolver will fail to resolve the principal parameter because there's some annotation on it.

I think this is a regression introduced by #19779

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 28, 2020
@sbrannen
Copy link
Member

This is a regression introduced by #25780.

@sbrannen sbrannen changed the title @Nonnull annotation breaks ServletRequestMethodArgumentResolver @Nonnull annotation breaks ServletRequestMethodArgumentResolver for Principal Oct 28, 2020
@sbrannen sbrannen added in: web Issues in web modules (web, webmvc, webflux, websocket) type: regression A bug that is also a regression and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 28, 2020
@sbrannen sbrannen added this to the 5.3.1 milestone Oct 28, 2020
@rstoyanchev rstoyanchev self-assigned this Oct 29, 2020
@rstoyanchev
Copy link
Contributor

rstoyanchev commented Oct 29, 2020

We might need to fall back on default resolution if a custom resolver didn't resolve it.

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: regression A bug that is also a regression
Projects
None yet
Development

No branches or pull requests

4 participants