Open grv87 opened 4 years ago
In JSON Schema Validation draft 07 such keywords are named annotation
keywords (as opposed to validation
).
I see what you are saying, and agree that something like that is needed.
I do not favor making it the default behavior, I think choosing the first is the most straight forward approach.
I think maybe changing the path array to contain the full path to the individual values in different allOf schemas is the way to go. Only worried about backwards compability. Maybe introduce a new variable..
Anyway: I do not currently have too much time to do just that, suggestions are welcome.
I think that the best way to handle fields
title
,description
andexamples
is to preserve what is declared in the schema itself and ignore everything coming fromallOf
items.Consider the following schema:
If we resolve
$ref
s and run merge, we gottitle
copied from the first type (Developer
). This just makes no sense.So, I need a custom resolver that could detect whether value comes from parent schema (and keep it) or from items of
allOf
(and ignore it).The problem is that it is impossible having current set of arguments resolver is called with. Please, add a way. Or, better, make this behavior as default.