Open spring-projects-issues opened 9 years ago
Oliver Drotbohm commented
A converter is not sufficient really as you need to take the Accept
header and content negotiation into account. You could implement an HttpMessageConverter} (probably extending or configuring a {{MappingJackson2HttpMessageConverter
) and register it on the configuration by overriding RepositoryRestMvcConfiguration.configureHttpMessageConverters(…)
Will Oemler commented
Does the HttpMessageConverter
have to be a subclass of MappingJackson2HttpMessageConverter
? Could you simply extend AbstractHttpMessageConverter
instead? I have a simple converter that writes to a tab-delimited text format, and works fine in vanilla Spring MVC, but not with Spring Data REST, even when registered in both RepositoryRestMvcConfiguration.configureHttpMessageConverters(…)
and WebMvcConfigurerAdapter.configureMessageConverters(...)
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Jack Matthews opened DATAREST-614 and commented
I need to serialize my json in http://jsonapi.org/ instead of HAL. I have tried modifying ObjectMapper by setting my own converters.
but this only modifies the "content" part of the payload. It still includes a whole lot of HAL boilerplate. Is there a way to register a custom json format and scrap the HAL one completely? I am happy to do the work in integrating this format but need some pointers in the best way to approach this
Affects: 2.1.6 (Dijkstra SR6)
1 votes, 3 watchers