纯JSON(非HAL格式)的Spring Data REST [英] Spring Data REST in plain JSON (not HAL format)
本文介绍了纯JSON(非HAL格式)的Spring Data REST的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Spring Data Rest应该如何准确配置为返回纯JSON而不是HAL(带有类似Hypermedia之类的链接的JSON)
How exactly should Spring Data Rest be configured to return plain JSON instead of HAL (JSON with Hypermedia like links)
相关
- Spring包含spring数据剩余时,将以纯JSON而非HAL格式返回Resource
- Spring Data Rest-在Json中禁用自我链接(HAL)
- 和大型禁用超文本应用程序语言( HAL)在JSON中?
- 使用 jsonapi 代替HAL
- Spring returns Resource in pure JSON not in HAL Format when including spring data rest
- Spring Data Rest -Disable self links(HAL) in Json
- and big Disable Hypertext Application Language (HAL) in JSON?
- using jsonapi instead of HAL Changing the JSON format for spring-data-rest
推荐答案
将以下属性添加到application.properties或yml中.默认情况下为application/hal + json
Add the below property to your application.properties or yml . By default it is application/hal+json
spring.data.rest.defaultMediaType = application/json
spring.data.rest.defaultMediaType=application/json
这篇关于纯JSON(非HAL格式)的Spring Data REST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文