-
Notifications
You must be signed in to change notification settings - Fork 470
should honor use-hal-as-default-json-media-type #532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
There's nothing in Spring HATEOAS that it could honor here as it doesn't know anything about Spring Boot. When you say "anymore" can you please clarify what you mean by that? Has something worked before that now doesn't anymore? Would you mind getting a bit more precise on what works and what doesn't? Maybe through a test case/project? |
I tried to migrate from 0.18 to 0.23 (0.22 had bug with context) In general spring-boot autoconfiguration doing same thing but honors flag use-hal-as-default-json-media-type. This registration adds application/json as supported media type for jackson configuration and causing HAL format by default. Now it seems that spring-hateoas doing it also in |
any news about this? |
seems that issue not appears anymore. |
@rainoko I am still seeing this issue. I am having a problem with getting |
Can you please list:
We need this level of detail to pinpoint what is happening. |
Hi @gregturn, Thanks for the response. I am trying to use
|
Gson is probably the issue right there. Spring HATEOAS is designed with a vendor neutral format and the actual styling into various forms of hypermedia is done through Jackson annotations and customized Jackson serializers/deserializers/mixins. This is definitely an area NOT tested with Spring HATEOAS, so I wouldn't expect to work if you disable Jackson and remove its autoconfiguration. |
Thanks for the tip. I have completely removed Gson from my app (pom, configuration, etc.) and I still see the same issue. |
Show me the method signature. If you are returning a list you're doing it wrong. If you return Resources, that should do the trick. |
@gregturn Yes that was the issue! I didn't see that anywhere in an example so had no clue that wouldn't work correctly. |
Well, there are, in fact, unit tests that breach this rule. It's why I've drafted #629, to either log a warning or cause your controller to fail fast if you return a type that you can't expect the HAL (or any future serializer) to handle. |
Spring boot introduced configuration use-hal-as-default-json-media-type which helps fallback from hal format links. spring-hateoas should honor this otherwise it is not compatible with boot anymore.
The text was updated successfully, but these errors were encountered: