Description
All,
I'm having an issue resolving a reference. Having tested a couple scenarios, I was happy to see that providing a top-level reference and included some other properties alongside the $ref netted me a merged/combined object, for example:
Dereferencing this:
{
"$ref":"http://someuri/myOtherSchema",
"anotherProperty":"whatever"
}
Results in this (imagining myOtherSchema contains the added properties):
{
"somePropertyFromMyOtherSchema": "misc",
"anotherPropertyFromMyOtherSchema":"more",
"anotherProperty": "whatever"
}
However, if I attempt to dereference the following:
{
"$ref": "http://someuri/foo",
"anotherProperty": {"$ref":"http://someuri/blah/some/field/value"}
}
It results in an error ('Error resolving $ref: http://someuri/blah/some/field/value'). It's worth noting that I am using a custom resolver and I changed the $ref urls for this post but removing the top-level $ref results in success i.e. my resolver is working as expected and in fact is a simple in-memory resolver. When this error happens the $ref mentioned in the error never even hits my resolver and its resolution is never attempted. Is having a top-level $ref alongside a property that points to a $ref expressly forbidden by the specification, is this a flaw or a feature of json-schema-ref-parser?