Referencing JSON Schema from json similar way XML references XML Schema Referencing JSON Schema from json similar way XML references XML Schema json json

Referencing JSON Schema from json similar way XML references XML Schema


You are correct, it is not part of the standard.

For JSON returned as an HTTP response, you can note using a header that the response JSON is described by a specific JSON Schema.

https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-01#section-10.1

It is RECOMMENDED that instances described by a schema provide a linkto a downloadable JSON Schema using the link relation "describedby",
as defined by Linked Data Protocol 1.0, section 8.1
[W3C.REC-ldp-20150226].

In HTTP, such links can be attached to any response using the Linkheader [RFC8288]. An example of such a header would be:

Link: http://example.com/my-hyper-schema#; rel="describedby"