-
-
Notifications
You must be signed in to change notification settings - Fork 590
Unable to resolve local subschemas through "$defs" #947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
@MatthewNielsen27 thanks, will have a look. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I didn't fully look at this yet, but just glancing at it again briefly, I don't think this has anything to do with |
I'm suspicious because When the search for the To put it plainly, the subschema resolution only considers a subset of valid subschema tags. |
(EDIT: Which isn't to say I know what the solution is yet, but yeah I'm reasonably sure that's not it). |
Ok, thanks for clearing that up. I think we can mark this as a duplicate of #544. |
Sounds good, will do, appreciate the report! |
The issue
The json-schema specification outlines the ability to reference local subschemas that are defined in
$defs
. Currently, aRefResolutionError
is raised when attempting to validate an instance of a schema that references local subschemas with$defs
.How to replicate
Running the following python code will raise a
RefResolutionError
.What I think is going wrong
Subschema references are resolved using the
_find_in_subschemas(...)
function which calls the following function:The issue is that
_SUBSCHEMAS_KEYWORDS
doesn't contain"$defs"
(currently it is only comprised of("$id", "id", "$anchor", "$dynamicAnchor")
)Proposed fix
Add
"$defs"
to_SUBSCHEMAS_KEYWORDS
.The text was updated successfully, but these errors were encountered: