You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which results in an unresolved '$ref': '#/%24defs/RecursiveModel/properties/children/items' after $RefParser.dereference(). As far as I can tell the newer schema should be valid.
Here's a full script showing the difference, and unresolved $ref
import$RefParserfrom"@apidevtools/json-schema-ref-parser";asyncfunctionmain(){console.log("----OLD----");constold_dereferenced=await$RefParser.dereference({"$defs": {"RecursiveModel": {"additionalProperties": false,"properties": {"value": {"description": "A string","type": "string",},"children": {"description": "Children with strings","items": {"$ref": "#/$defs/RecursiveModel",},"type": "array",},},"required": ["value","children"],"title": "RecursiveModel","type": "object",},},"allOf": [{"$ref": "#/$defs/RecursiveModel",},],});console.log(old_dereferenced["$defs"]["RecursiveModel"]["properties"]);console.log("----NEW----");constnew_dereferenced=await$RefParser.dereference({"$defs": {"RecursiveModel": {"additionalProperties": false,"properties": {"value": {"description": "A string","type": "string",},"children": {"description": "Children with strings","items": {"$ref": "#/$defs/RecursiveModel",},"type": "array",},},"required": ["value","children"],"title": "RecursiveModel","type": "object",},},"$ref": "#/$defs/RecursiveModel",});console.log(new_dereferenced["$defs"]["RecursiveModel"]["properties"]);}main();
Pydantic recently released an update changing their JSON schema generator.
Previously the generated schema looked like
which dereferences properly with json-schema-ref-parser. However, now the generated schema looks like
which results in an unresolved
'$ref': '#/%24defs/RecursiveModel/properties/children/items'
after$RefParser.dereference()
. As far as I can tell the newer schema should be valid.Here's a full script showing the difference, and unresolved
$ref
I get the output
Is this expected? Should I be using some different option?
The text was updated successfully, but these errors were encountered: