Skip to content

ProblemDetail is missing serialization hints for Native Image #29801

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
phejl opened this issue Jan 11, 2023 · 0 comments
Closed

ProblemDetail is missing serialization hints for Native Image #29801

phejl opened this issue Jan 11, 2023 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) theme: aot An issue related to Ahead-of-time processing type: bug A general bug
Milestone

Comments

@phejl
Copy link

phejl commented Jan 11, 2023

Spring AOT/Native Image:

  1. Use ResponseEntityExceptionHandler as a base class for your @ControllerAdvice
  2. Trigger BAD_REQUEST on your endpoint (for example sending empty POST, on endpoint with @RequestBody).
  3. Response returned is of content type Content-Type: application/problem+json with body {}

When you manually configure org.springframework.http.ProblemDetail for reflection the response body is {"type":"about:blank","title":"Bad Request","status":400,"detail":"Failed to read request","instance":"/your/endpoint"}

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 11, 2023
@bclozel bclozel self-assigned this Jan 16, 2023
@bclozel bclozel added in: web Issues in web modules (web, webmvc, webflux, websocket) theme: aot An issue related to Ahead-of-time processing type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 16, 2023
@bclozel bclozel added this to the 6.0.5 milestone Jan 17, 2023
@bclozel bclozel changed the title ProblemDetail not configured for json binding ProblemDetail is missing serialization hints for Native Image Jan 17, 2023
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) theme: aot An issue related to Ahead-of-time processing type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants