Open jvandegriff opened 3 years ago
How to reference the schema is not too hard: probably add a link to it in the status block, for example.
Question: is there a standard way for JSON to advertise the presence of a schema?
Question: are there multiple JSON schema syntax options? Ans: they seem to have converged and we use: json-schema.org
This will take some research and time.
Need to then add schema refs to all the examples.
Should 3.2 require a schema to be present? Maybe wait for 4.0 to require it?
There is no standard way for JSON to announce that it is following a schema. Also, JSON Does not have namespaces. See this issue from the JSON schema people:
https://github.com/json-schema-org/json-schema-spec/issues/828
So how we manage this is probably up to us.
From https://cdaweb.gsfc.nasa.gov/hapi/capabilities
{
"$schema": "https://hapi-server.org/schemas/3.2/schema",
-OR- one schema for each end point
"$schema": "https://hapi-server.org/schemas/3.2/capabiliites/schema",
"HAPI": "2.0",
"status": {"code": 1200, "message": "OK"},
"outputFormats": ["csv","json","binary"]
}
Probably one line is enough.
Maybe consider putting the web link in the schema key:
"$https://json-schema.org/schema": "https://hapi-server.org/schemas/3.2/schema",
-OR- one schema for each end point
"$https://json-schema.org/schema": "https://hapi-server.org/schemas/3.2/capabiliites/schema",
Conclusion:
$schema
$schema: "https://hapi-server.org/schemas/HAPI-3.2.json#capabilites"
in all responses. It may be that we would have to split up a single file `$schema: "https://hapi-server.org/schemas/3.2/capabilites", which will take some effort.Wait on item 2. till version 4.0.
Do item 1. asap.
Item 1. is tracked in https://github.com/hapi-server/data-specification/issues/188
And the schemas should be put online with DOIs.