I saw in the source code that Spring DATA Rest can expose a Json Schema for a repository with this URL : /{repository}/schema.
Is there anybody who know how to configure this ?
There is the RepositorySchemaController (org.springframework.data.rest.webmvc) but i have not found how to use it.
version : 2.0.0.M1
Make sure you set the right headers...
Request - /{repository}/schema
Header - Accept: application/json+schema
Also if you haven't looked into 2.0 snapshots, there are lot more features and changes coming up
EDIT: Jan 27 2014
Correction:
Accept should be "application/schema+json
" instead of "application/json+schema
"
Request - /{repository}/schema
Header - Accept: application/schema+json
Just an update for version 2.4.0
of Spring Data REST:
JSONSchema is now exposed under the profile
link, so you need to change your request as follows:
Request: /profile/{repository}
Header: Accept: application/schema+json
You can find the updated documentation here.
来源:https://stackoverflow.com/questions/21169937/spring-data-rest-how-to-expose-a-json-schema-from-a-repository-2-0-0-m1