I'm trying to get a grip on how id's are resolved. I've read section 8.2 in http://json-schema.org/latest/json-schema-core.html and it covers some cases, but doesn't cover the one I'm seeing.
Taking the test case from section 8.2 and changing it a bit, what are the new dereferenced names.
{ "id": "http://example.com/root.json#base",This is my stab at the results....
"properties" : {
"lnk" : { "$ref": "#WHATS MY REFERENCE TO A" }
}
"definitions": { "A": { "id": "#foo" }, "B": { "id": "other.json", "definitions": { "X": { "id": "#/bar" }, "Y": { "id": "t/inner.json" } } }, "C": { "id": "urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f"
} } }
Underlying this I have a schema which looks a bit like this
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "#definitions/account",
"title": "account",
"type": "object",
"properties": {
"link": {"$ref": "#/definitions/Link"}
},
"definitions": {
"Link": {}
}
}
Is this valid? and if it is can someone explain how what effect the id has when resolving #/definitions/Link
Thanks
Simon
"lnk" : { "$ref": "#foo" }
"lnk" : { "$ref": "http://example.com/root.json#foo" }
http://example.com/root.json#foo
and
http://example.com/root.json#/foo