Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Data Rest : How to expose a json schema from a repository (2.0.0.M1)

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

like image 226
bwilcox Avatar asked Oct 02 '22 20:10

bwilcox


1 Answers

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
like image 76
Stackee007 Avatar answered Oct 05 '22 11:10

Stackee007