Does JSON Schema validation in common-js utils support references? I can not do this with https://github.com/kriszyp/commonjs-utils/blob/master/json-schema.js
I tried following code:
{
"type" : "object",
"required" : true,
"properties" : {
"id" : {
"type" : "number",
"required" : true
},
"related" : {
"type" : "array",
"required" : true,
"items" : {"$ref": "$#"}
}
}
}
I can go ahead and prepare my schema with out references, but it would be nice to know if it is possible.
I do not know, however your ref seems to be wrong, remove the "$" sign i.e.:
Here is a copy pasted post I put on the json forum concerning references:
According to the draft 03 here is what I understood about specifying an id and referencing it from anywhere. Please comment if something is wrong. The cases are written in the following : a. The uri from where I retrieve the schema b. the schema got c. how to refer to this schema