Replies: 1 comment
-
Addressed in #310 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently JSI returns a default value in place of a nonexistent child, when a schema defines one.
The meta-schemas use default values for schemas and other things, in particular defaults of an empty schema (draft 6) or
true
schema (draft 7) where a schema is described.This behavior seems unintuitive and potentially problematic. Child schemas which are not present returning
nil
seems more what one would expect.Specifications after draft 7 no longer specify a default value for a schema, but these are much less widely in use (and not supported in JSI as of this writing).
JSI could, by default, not return a default value when the default comes from a meta-schema. Having different rules for schemas than for other instances is not my favorite, but I already do similar to decide whether to instantiate a child as a JSI so that boolean schemas are returned as schemas instead of plain booleans.
Or JSI could always default to not return defaults values.
Beta Was this translation helpful? Give feedback.
All reactions