In PoC stage to develop a HATEOAS REST API. Zeroed in on json-schema for everything schema. I am expecting clients to use this schema to smartly create forms on the fly to create new resources. Just not sure when to return it?
Possible options could be:
The JSON Schema documentation includes two recommendations for correlating documents with schemas.
The first and most popular is to use the profile
Content-Type
header attribute.
Content-Type: application/my-media-type+json; profile="http://example.com/my-hyper-schema#"
The other recommendation (that I have never actually seen anyone use) is a Link
header with rel=describedBy
.
Link: <http://example.com/my-hyper-schema#>; rel="describedBy"
Reference: http://json-schema.org/latest/json-schema-core.html#anchor33