Open
Conversation
603fd2e to
bad6a5d
Compare
erosb
reviewed
Aug 18, 2022
Contributor
erosb
left a comment
There was a problem hiding this comment.
Thank you for raising the PR. Added a couple of notes.
One more question: do you think it is possible to change the SchemaLoader so that the subschemas appearing under "$defs" are added to Schema#definitionSchemas ? I know it won't be a trivial code change, but maybe it is feasible?
|
|
||
| @Override void visitDefinitionSchemas(Map<String, Schema> definitionSchemas) { | ||
| if (!definitionSchemas.isEmpty()) { | ||
| writer.key("definitions"); |
Contributor
There was a problem hiding this comment.
Maybe better to use $defs since that is the currently recommended keyword according to the spec?
| } | ||
| } | ||
|
|
||
| void visitDefinitionSchemas(Map<String, Schema> definitionSchemas) { |
Contributor
There was a problem hiding this comment.
Are you sure this makes sense? It may trigger unnecessary validation. For example if the schema is
{
"type": "object",
"properties": {
"A": { "type": "string" }
},
"required": ["A"']
"$defs": {
"A": { "type": "integer" }
}
}Then I suspect no instance would pass the validation (the "A" prop would be validated against both {"type":"string"} and { "type": "integer" }).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the ability to configure definition schemas.