-
Notifications
You must be signed in to change notification settings - Fork 563
Description
Hi,
Starting from Spring Boot 2.5, all buttons in HAL Explorer except GET are disabled at the first time.
Reproducing the problem
- Initialize Spring Boot project at https://start.spring.io/ including following dependencies:
- spring-boot-starter-data-jpa
- spring-boot-starter-data-rest
- spring-boot-starter-web
- spring-data-rest-hal-explorer
- h2 database
- Make a single entity class and its repository implementing
JpaRepository - Run Spring Boot application
- See HAL explorer web page
The cause of this problem
According to toedter/hal-explorer#28, This is intended behavior for hal explorer as the data rest api responds with the Content-Type: application/hal-forms+json. However, it seems we don't have a workaround for this problem like forcing response content type to application/hal+json. We have a spring boot property named spring.data.rest.default-media-type, but it takes no effect.
We have to give some option for HAL explorer to request certain content-type of the api endpoints like forcing Accept header, so that the HAL explorer recognizes the endpoint properly and shows every button like it used to do before spring boot version 2.5.
This is first mentioned in #2017
Thanks.