Open DetachHead opened 1 year ago
The issue here is that at the root of your document, you have an invalid JSON Reference because $ref
cannot be adjacent to any other properties. If you use #findRefs
, you get the following:
{
'#': {
def: { '$ref': '#/definitions/Foo', definitions: [Object] },
uri: '#/definitions/Foo',
uriDetails: {
scheme: undefined,
userinfo: undefined,
host: undefined,
port: undefined,
path: '',
query: undefined,
fragment: '/definitions/Foo',
reference: 'same-document'
},
type: 'local',
warning: 'Extra JSON Reference properties will be ignored: definitions'
}
}
So while a JSON Reference is found, it's invalid and resolution will fail. This is a "garbage in, garbage out" kind of situation. I've thought about how to handle this and the first option would be to just not attempt to resolve invalid JSON References. That's about the only clean option we have. Thoughts?
thanks for the reply. this schema was generated by pydantic so i raised it there and will see what they say https://github.com/pydantic/pydantic/issues/5316