Closed science closed 8 years ago
Normally we use the $ref
property to define a external reference, or to 'dry' our schemas.
Example:
// some-schema.json
"definitions": {
"agentCategory": {
"type": "string",
"enum": [ .... ]
}
}
// other-schema.json
"myfield": { "$ref": "some-schema.json#definitions/agentCategory" }
but there is this caveat of having to jump on differente schemas. We can:
I did a proof-of-concept with the erb templates already, but did not used at the end (can easily rebuild it).
On the PR above we added an engine for loading schemas from composable ERB templates. I.e, we can add embeded definitions or resolve ref dinamically.
We refactored all the current schemas to use this new engine.
Using this we could reuse, partially, the definitions we generated on https://github.com/learningtapestry/json-schema.org
I'll close this for now, but if something new comes up we might reopen/rediscuss.
In my call yesterday with CTI, the question was raised by @stuartasutton as to how we can provide linked data references to remote controlled vocabularies in our json-schema validation system.
For example, right now we have
agentCategory
defined as:I think those labels have actually been defined at some remote URL already. So it would be great if we could provide a URL reference to that. The simplest way seemed to be using the "description" field to provide that information.
Stuart thought there might be a more formal method to making the association in a way that was machine-readable?
My only concern was that if we just provided a URL to the labels, then programmers have to hop around between different schema files to figure out what's permissible, and that makes their jobs harder..
Thoughts? Ideas?