You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Spring 5.1.8, Spring Boot 2.1.6, and Spring HATEOAS 0.25.1.
For some resource, I essentially want to do what spring boot actuator does: serve my resources with a custom media type by default, but keep the responses HAL+JSON-compatible.
For that to work, it seems like I need to essentially duplicate ConverterRegisteringWebMvcConfigurer, or alternatively ensure that it runs before my own WebMvcConfigurer so I can find and reuse the custom ObjectMapper with the Jackson2HalModule already registered, then insert my custom HttpMessageConverter in front of the one it inserts.
(The snippet probably overuses the Stream API, please let me know if that distracts from the issue.)
This configuration feels more like I'm fighting the API than using it, is there an easier way ot accomplish what I want that I'm missing?
If there isn't, it would be really nice if there were a better way to extend the HAL+JSON-compatible HttpMessageConverter or provide custom ones, or maybe just if there were a way to access the HAL-enabled ObjectMapper that ConverterRegisteringWebMvcConfigurer constructs.
The text was updated successfully, but these errors were encountered:
I'm using Spring 5.1.8, Spring Boot 2.1.6, and Spring HATEOAS 0.25.1.
For some resource, I essentially want to do what spring boot actuator does: serve my resources with a custom media type by default, but keep the responses HAL+JSON-compatible.
For that to work, it seems like I need to essentially duplicate
ConverterRegisteringWebMvcConfigurer
, or alternatively ensure that it runs before my ownWebMvcConfigurer
so I can find and reuse the customObjectMapper
with theJackson2HalModule
already registered, then insert my customHttpMessageConverter
in front of the one it inserts.(The snippet probably overuses the Stream API, please let me know if that distracts from the issue.)
This configuration feels more like I'm fighting the API than using it, is there an easier way ot accomplish what I want that I'm missing?
If there isn't, it would be really nice if there were a better way to extend the HAL+JSON-compatible
HttpMessageConverter
or provide custom ones, or maybe just if there were a way to access the HAL-enabledObjectMapper
thatConverterRegisteringWebMvcConfigurer
constructs.The text was updated successfully, but these errors were encountered: