Description
The specification for default
is insufficient in terms of its requirements for implementations.
At minimum we have to think about the implications for further validation. The current specification suggests that a value for default
that does not validate against the provided schema. However there are more implications presented by default
. For example the effect of default
if the property is also required
. If default
does not satisfy required
then its purpose is unclear at best and misleading at worst.
I have created a PR against the test-suite with this in mind.
In my opinion the specification should be clearer by stating that the value for default
MUST be valid according to the provided schema. The presence of default
should also satisfy other schema criteria such as required
.
I am maintaining a JS implementation (draft3 & draft4) for corporate in-house use (open-sourcing is in progress). It has the option to actually modify the original JSON-Document, or alternatively keep it untouched but continue validation as if the default value had been there all along. We have yet to come across a situation where this was insufficient or unclear.