Most links are not showing up with Spring Boot 2.5.0
eiswind opened this issue · comments
@eiswind
The content-type in your response header is application/prs.hal-forms+json
.
In this case only GET request is displayed in HAL Explorer.
In case you planned to make a HAL-FORMS example, this seems intended behaviour.
For a HAL example content-type should be application/hal+json
.
Best
Patrick
@pmoule, you are right. This is on purpose with HAl-FORMS media type, since HAL-FORMS provides affordances (_templates) for exactly those use cases. If you want to provide create or delete functionality, you would define the respective affordances.
BTW, the media type for HAL is application/hal+json
@eiswind, when you are using String HATEOAS you can choose from a list of supported media types. Spring Data REST only supported HAL in the past but they are also moving to HAL-FORMS.
Thanks for clearing this up! I didn't catch that change.
This must be a new behaviour of data-rest then. I just updated the spring boot version an got this new content-type w/o further changes. I'll have to investigate a little further.
Thanks for pointing this out, I will check with latest Spring Data REST versions soon.
This must be a new behaviour of data-rest then. I just updated the spring boot version an got this new content-type w/o further changes. I'll have to investigate a little further.
Did you find out how to suppress HAL-FORMS support in Spring Data REST or Spring HATEOAS for HAL Explorer to continue working for all HTTP Methods as it was working with previous versions of SpringBoot (2.4.9 earlier)?
@pravinkalekar just set the content-type header to application/hal+json in the ui.
@pravinkalekar just set the content-type header to application/hal+json in the ui.
I still don't understand how to suppress hal-forms. I couldn't find the location to set the content-type header in the Spring Boot HAL explorer ui. Could you explain with more details to control it?
@djkeh
Use the "Edit Headers" button in the top left corner next to the API URL to set the content-type header.
@pravinkalekar Wow. I couldn't see that button. Thanks!
For those who want more accurate information, in order to get application/hal+json
content-type response, I can set my request header using Accept
key.
Tested on Spring Boot 2.5.4