spring data rest - How to expose JSON Hyper-Schema from SDR repositories? -
i'm working in small sdr poc project in decided use json-schema because more meaningful our purposes since trying develop client understand hypermedia , create part of our view dynamically, i'm in trouble find hypermedia metadata entities using json-schema.
these entities i'm using
@entity public class book { (...) @onetomany(mappedby="book") @jsonmanagedreference private set<page> pages; } @entity public class page { (...) @manytoone @jsonbackreference private book book; }
when perform on /profile/books using accept header value "application/schema+json":
curl -h 'accept:application/schema+json' http://localhost:8080/profile/books
i receive output:
{ "title": "book", "properties": { "pages": { "title": "pages", "readonly": false, "type": "string", "format": "uri" }, "name": { "title": "name", "readonly": false, "type": "string" } }, "definitions": {}, "type": "object", "$schema": "http://json-schema.org/draft-04/schema#" }
this json-schema output doesn't have links crud operations book entity, nor links related entities pages or metadata define properties.
the default alps output (http://tools.ietf.org/html/draft-amundsen-richardson-foster-alps-01) provided /profile isn't meaningful enough because not shows possible action links entity , nor specific types.
the hal output (https://tools.ietf.org/html/draft-kelly-json-hal-07) /books describe links book instances , interaction links other entities nothing metadata.
what correct way output json-schema metadata entity in sdr? there way in able produce json hyper-schema (http://tools.ietf.org/html/draft-luff-json-hyper-schema-00) sdr resource ?
Comments
Post a Comment