From reading another question, I learned that Spring Data Rest exposes a JSON schema at: /{resourceName}/schema. Ex:
GET http://localhost:8080/members/schema Accept : application/schema+json
{
"name": "org.jxc876.model.Member",
"description": "rest.description.member",
"links": [],
"properties": {
"id": {
"type": "long",
"description": "rest.description.member.id",
"required": false
},
"alias": {
"type": "string",
"description": "rest.description.member.alias",
"required": false
},
"name": {
"type": "string",
"description": "rest.description.member.name",
"required": false
}
}
}
I want to indicate that certain fields are required. I initially tried using Bean Validation annotations (@NotNull) and Jackson (@JacksonProperty) annotations but neither seemed to trigger the flag.
Note: I am using Spring Data Rest 2.2.1