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

Mismatch between documented and actual message code handling for ErrorResponse #32415

Closed
ZeroCyan opened this issue Mar 11, 2024 · 1 comment
Closed
Labels
status: superseded An issue that has been superseded by another

Comments

@ZeroCyan
Copy link
Contributor

ZeroCyan commented Mar 11, 2024

There is a discrepancy between the documentation and the actual implementation regarding the message codes for ErrorResponses.

https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-ann-rest-exceptions.html#mvc-ann-rest-exceptions-i18n describes the following pattern:

The default strategy for message codes follows the pattern: problemDetail.[type|title|detail].[fully qualified exception class name]

As you can see in the following references, detail is not used when searching for the message code. This does happen for problemDetail.title and problemDetail.type

return "problemDetail.type." + exceptionType.getName();

return "problemDetail.title." + exceptionType.getName();

return "problemDetail." + exceptionType.getName() + (suffix != null ? "." + suffix : "");

Expected message code according to documentation:

  • problemDetail.detail.org.springframework.web.bind.MethodArgumentNotValidException

Actual message code that gets resolved

  • problemDetail.org.springframework.web.bind.MethodArgumentNotValidException
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Mar 11, 2024
@ZeroCyan ZeroCyan changed the title Mismatch between documented and actual message code handling for ErrorResponses Mismatch between documented and actual message code handling for ErrorResponse Mar 11, 2024
@snicoll
Copy link
Member

snicoll commented Mar 15, 2024

Closing in favor of PR #32446

@snicoll snicoll closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
@snicoll snicoll added status: superseded An issue that has been superseded by another and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

3 participants