Spring Data Rest:如何从存储库 (2.0.0.M1) 公开 json 模式 [英] Spring Data Rest : How to expose a json schema from a repository (2.0.0.M1)
问题描述
我在源代码中看到 Spring DATA Rest 可以使用以下 URL 公开存储库的 Json Schema:/{repository}/schema.
I saw in the source code that Spring DATA Rest can expose a Json Schema for a repository with this URL : /{repository}/schema.
有人知道如何配置吗?
有 RepositorySchemaController (org.springframework.data.rest.webmvc) 但我还没有找到如何使用它.
There is the RepositorySchemaController (org.springframework.data.rest.webmvc) but i have not found how to use it.
版本:2.0.0.M1
version : 2.0.0.M1
推荐答案
确保设置正确的标题...
Make sure you set the right headers...
Request - /{repository}/schema
Header - Accept: application/json+schema
此外,如果您还没有查看 2.0 快照,还有更多功能和变化即将推出
Also if you haven't looked into 2.0 snapshots, there are lot more features and changes coming up
2014 年 1 月 27 日
更正:接受应该是application/schema+json
"而不是application/json+schema
"
Request - /{repository}/schema
Header - Accept: application/schema+json
这篇关于Spring Data Rest:如何从存储库 (2.0.0.M1) 公开 json 模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!