SpringBoot 2.3.+ and Spring Data Rest: Return empty Array instead of EmptyCollectionWrapper

We had the same Issue as mentioned in here and used the provided workaraound with a resourceprocessor.

Spring Data REST returns EmptyCollectionEmbeddedWrapper instead of empty collection

now we moved on to SpringBoot 2.3, which updates its dependencies to HATEOAS 1.x and those brought a lot of breaking changes. following the migrationguide for HATEOAS 1.x fixed the compiler errors, though left us with runtime exceptions when Spring is trying to cast classes but cannot.

we would love to have an generic approach to layer no matter which rest endpoint and return an empty array instead of the CollectionWrapper with its null attributes. adjusting it for each model is not maintainable.

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.