Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Refine Spring HATEOAS hints. #772

Merged

Conversation

christophstrobl
Copy link
Contributor

This PR updates HateoasHints to scan for components that configure certain Hypermedia types such as HAL and UBER instead of maintaining static @TypeHint declarations.

User code and spring jars will also be scanned for usage of Jackson2 annotations, modules and de-/serializers, registering those as well as all jackson annotations on them.
Custom RepresentationModels, their RepresentationModelProcessor and the target domain types are also looked up and registered.

An optimization, that extracts the HypermediaType from @EnableHypermediaSupport(type = {...}) and only registers the above mentioned hints for the configured formats, was moved to a separate commit (13d7abb) as we may want to introduce this in a later stage - feel free to drop it.

To cover Jackson2 de-/serializer, types annotated with (at) Configuration and those implementing EntityLink.
Use the (at) EnableHypermediaSupport annotation to only register configured media types, their configuration and jackson mappings which saves about 2.5 MB
@christophstrobl christophstrobl requested a review from odrotbohm May 10, 2021 11:55
@sdeleuze sdeleuze added this to the 0.10.0 milestone May 11, 2021
@sdeleuze sdeleuze added the type: compatibility Native image compatibility issue label May 11, 2021
@sdeleuze sdeleuze merged commit 8f250b4 into spring-attic:main May 11, 2021
@sdeleuze
Copy link
Contributor

@odrotbohm I potentially merged that one too fast because the CI checks were green, I should have wait your review. If you find something please let @christophstrobl and me know we can refine with additional commits.

@odrotbohm
Copy link

odrotbohm commented May 11, 2021

Please don't worry too much about me. From what I saw in general this heads in the very right direction and it's even easier to play with for me if it's consumable via snapshots in the first place. I'll have a look at how this works with the RESTBucks sample ASAP.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: compatibility Native image compatibility issue
Development

Successfully merging this pull request may close these issues.

3 participants