I am building a web service where my clients can only accept application/json as a response. But Spring Hateoas seems to not respect my produces in the GetMapping annotation, and always returns HAL.
I have already tried: putting
spring.hateoas.useHalAsDefaultJsonMediaType=false
also in kebab case:
spring.hateoas.use-hal-as-default-json-media-type=false
Also putting
spring.data.rest.defaultMediaType=application/json
I have tried putting produces=application/json in the @GetMapping annotation and in the controller.
We have also tried implementing:
SpringRestConfiguration implements RepositoryRestConfigurer...
None of these things worked.
Our spring boot version is 2.0.8
We expect the response json to be in application/json without the "_embedded" for a list of resources.