Returned json unexpected, has “links” spelled as “_links” and structure different, in Spring hateoas

前端 未结 6 1776
情书的邮戳
情书的邮戳 2021-01-02 02:56

As the title says, I have a resource object Product extending ResourceSupport. However, the responses I receive have the property \"_links\" instea

6条回答
  •  执念已碎
    2021-01-02 03:19

    Another option would be to disable the whole hypermedia auto-configuration feature (this is how it's done in one of the spring-boot + REST examples here):

    @EnableAutoConfiguration(exclude = HypermediaAutoConfiguration.class)
    

    As far as I know, HypermediaAutoConfiguration doesn't really do much except for configuring HAL, so it should be perfectly fine to disable it.

提交回复
热议问题