In RAML one can specify the bodies of requests / responses by including a JSON Schema:
#%RAML 1.0 title: My API version: v1 baseUri: http://example.com mediaType: - application/json types: Entity: !include schema.json#definitions/Entity PostEntity: !include schema.json#definitions/PostEntity /entities: post: body: type: PostEntity responses: 201: body: type: Entity
I’d like to conform my API to the JSON-API spec. However, I am not sure how to create my
schema.json to describe the
PostEntity bodies. Is there a way to reuse the JSON-API Schema and only specialize the data models (I’m thinking about the resource
attributes in particular) or should I rewrite my schema from scratch to specify my data models and try conform to JSON-API ? If so, is there a way to test the conformance of my own schema, apart from testing payloads from my own schema against the JSON-API schema ?
I failed to find a good RAML (or API Blueprint or OpenAPI) + JSON-API workflow online. How and where do people usually define JSON-API models (payloads) ?