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

Wrap all message converters from spring-data-rest with a multipart-supporting message converter #2189

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

vierbergenlars
Copy link
Contributor

@vierbergenlars vierbergenlars commented Nov 5, 2024

In spring-data-rest 4.4.0, the logic has changed and now
RepresentationModelis being passed to canRead() instead of
PersistentEntityResource.

To support both versions of spring-data-rest for a while, we can wrap all
message converters with one that supports multipart and converts it to
JSON. This also allows users to configure their own specific HttpMessageConverters
and have it automatically work with multipart as well.

@vierbergenlars
Copy link
Contributor Author

vierbergenlars commented Nov 5, 2024

There is another problem introduced in that version of spring-data-rest (spring-projects/spring-data-rest#2425), which may make the tests fail anyways on spring boot 3.3.5.

I already wanted to get this PR opened because I had to fix this issue anyways during my investigation into why our contentgrid-spring tests were failing

As of spring boot 3.4.0, the issue mentioned above is resolved. But spring-data-rest has still changed which class they pass to canRead, so this PR makes it support both.

…pporting message converter

In spring-data-rest 4.4.0, the logic has changed and now
`RepresentationModel`is being passed to `canRead()` instead of
`PersistentEntityResource`.

To support both versions of spring-data-rest for a while, we can wrap all
message converters with one that supports multipart and converts it to
JSON. This also allows users to configure their own specific HttpMessageConverters
and have it automatically work with multipart as well.
@vierbergenlars vierbergenlars changed the title Make RepositoryEntityMultipartHttpMessageConverter resolve json HttpMessageConverter when it is being used. Wrap all message converters from spring-data-rest with a multipart-supporting message converter Nov 25, 2024
@vierbergenlars vierbergenlars marked this pull request as ready for review November 25, 2024 14:30
@paulcwarren paulcwarren merged commit dd3cc54 into paulcwarren:main Nov 28, 2024
5 checks passed
@paulcwarren
Copy link
Owner

Thanks @vierbergenlars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants