how unevauatedXXX interacts with older drafts #363
Replies: 3 comments 6 replies
-
That's a really interesting question. However, I'm not sure I can find supporting requirements from the specifications. Annotations existed in draft-07, but I don't see that we defined that However, I also know (I think?) that Hyperjump doesn't use the annotations process fully for this purpose, so I'd have to nudge @jdesrosiers to explain why this works in his implementation. I'll also nudge @gregsdennis to see if he can test this with his implementation. (Jason's is the only one which allows for multiple files in a playground, and I don't have a .net envrionment.) |
Beta Was this translation helpful? Give feedback.
-
I've thought about this sort of case recently while writing referencing tests. I don't personally put a lot of weight in what implementations do relative to what the spec says they should do, so since I don't think this sort of case is well-defined in the spec, nor likely to have been explicitly considered, I think to me the answer should be "it's undefined behavior in the current spec". Morally, if I think about what I believe we should write in a future spec, I think the answer should be the instance you showed should be invalid with |
Beta Was this translation helpful? Give feedback.
-
That's an interesting question that I don't think I've ever considered. The "unevaluated" keywords could have been defined in terms of their behavior only and not coupled to annotations. Using annotations to implement these keywords is an implementation detail, it's not an intrinsic part of the behavior of these keywords. If the spec did describe the behavior independent of annotations, I would say that properties declared in a draft-07 schemas should apply. However, since the spec does couple this behavior to annotations, I would say that the technically correct behavior is that properties declared in a draft-07 schema should not be counted as evaluated properties because a draft-07 Assuming that analysis is correct, the technically correct behavior isn't very helpful or intuitive. I think people would expect that the draft-07 properties would be counted. I think the solution is to redefine the "unevaluated" keywords to decouple them from annotations. That should make their behavior compatible with any dialect including custom keywords that might define properties (Example: However, that doesn't provide a clear answer to how 2019-09 and 2020-12 should be interpreted. I weigh intention very highly, sometimes above what the spec technically says. I don't think there was intention to exclude other keywords that declare properties, whether it's |
Beta Was this translation helpful? Give feedback.
-
consider I have following files:
if I validate
inst.json
withschema.json
what will be the result? is it valid or invalid?I guess draft7 does not generate annotations for
properties
keyword. So propertyfoo
is still considered unevaluated.currently my validator implementation tracks what is being evaluated irrespective of draft version. I would like to know the expected behaviour.
Beta Was this translation helpful? Give feedback.
All reactions