spring-projects / spring-projects/spring-data-rest
RepositoryRestMvcConfiguration should use defaultMessageConverters in extendHandlerExceptionResolvers
@odrotbohm is already working on this.
Since Nov 11, 2024.
- Dominant language
- Java
- Stars
- 958
- Forks
- 568
- PR merge metrics
- No merged PRs in 30d
Description
Right now the RepositoryRestMvcConfiguration uses the defaultMessageConverters property :
https://github.com/spring-projects/spring-data-rest/blob/56c271dee118f713fd8dc0999828738a1c1abae8/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java#L776
which is lazily loaded to all beans matching type HttpMessageConverter
https://github.com/spring-projects/spring-data-rest/blob/56c271dee118f713fd8dc0999828738a1c1abae8/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java#L291
However there is also a bean defined:
https://github.com/spring-projects/spring-data-rest/blob/56c271dee118f713fd8dc0999828738a1c1abae8/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java#L798
that I think should be used instead. The property isn't necessary and circumvents application wide customization of the message converters present in the bean:
https://github.com/spring-projects/spring-data-rest/blob/56c271dee118f713fd8dc0999828738a1c1abae8/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/RepositoryRestMvcConfiguration.java#L828
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.