paulcwarren / spring-content

Cloud-Native Storage and Enterprise Content Services (ECMS) for Spring
https://paulcwarren.github.io/spring-content/
Apache License 2.0
275 stars 67 forks source link

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

Closed vierbergenlars closed 5 days ago

vierbergenlars commented 3 weeks ago

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 commented 3 weeks ago

There is another problem introduced in that version of spring-data-rest (https://github.com/spring-projects/spring-data-rest/issues/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.

paulcwarren commented 5 days ago

Thanks @vierbergenlars