So I have one json schema and within this schema I am referencing another two schemas within the same json file, this works fine.
{
"id": "http://ourdns.co.za/public/assets/json/formSchema.json",
"type": "object",
"properties": {
"person": {
"type": "object",
"id": "#person",
"properties": {
"first_name": {
"title": "What is your first name",
"type": "string"
},
"last_name": {
"title": "What is your last name",
"type": "string"
}
}
},
"person_api": {
"type": "object",
"id": "#person"
}
}
}
What i would like to have is a root json schema that references two other json schemas that are external to the root. This differs from my current schema where I have all the schemas in one file(not ideal). There is a slight problem in that I cannot use $ref
as a reference keyword because the plugin we are using does not support this. However we have found that id
can be used as a reference keyword.(JsonForm is the plugin). How would we then get these using the id
keyword because it does not seem to work?
{
"id": "http://ourdns.co.za/public/assets/json/formSchema.json",
"type": "object",
"properties": {
"person_api": {
"type": "object",
"id": "public/assets/person.json"
}
}
}
1) How do we call the same data externally, like.. "id": "public/assets/person.json"
instead of combining it all in one file?
2) How would we retrieve particular properties for example if we only need person.firstname
from person.json schema?
{
"id": "http://dsn.co.za/public/assets/json/person.json",
"type": "object",
"properties": {
"first_name": {
"title": "What is your first name",
"type": "string"
}
}
}