You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
default mode (mode: "default") is trying to be mostly compatible with JSON Schema specification, with the exception of e.g. not allowing unknown keywords by default (unless unkownKeyword: true or mode: "lax" is specified) and detecting other kind of mistakes which are uncommon to be legitemately present in schemas.
strong mode (mode: "strong") enables all the additional checks (like enforceValidation: true) that do meaningful things, e.g. ensuring that additionalProperties are not missing and no unvalidated input slips through, that pattern keywords are anchored, that required is present with properties, etc. That is significantly incompatible with the upstream spec though and will complain on a lot of the schemas from the ecosystem.
lax mode disables some of even the default mode coherence checks and is most compatible to the bad decisions in the upstream specification (e.g. ignoring unknown keywords).
Currently, validator is in default mode by default (to be mostly compatible), parser is in strong mode by default (as it's a specific feature).
Perhaps, for v2, it would make sense to make validator configuration stronger by default, e.g. enabling enforceValidation: true and perhaps some more of the strong mode checks.
Perhaps some data from the linter usage could help -- it would make sense to run the linter in strong mode by default and allow relaxing individual checks.
The text was updated successfully, but these errors were encountered:
Currently:
default
mode (mode: "default"
) is trying to be mostly compatible with JSON Schema specification, with the exception of e.g. not allowing unknown keywords by default (unlessunkownKeyword: true
ormode: "lax"
is specified) and detecting other kind of mistakes which are uncommon to be legitemately present in schemas.strong
mode (mode: "strong"
) enables all the additional checks (likeenforceValidation: true
) that do meaningful things, e.g. ensuring thatadditionalProperties
are not missing and no unvalidated input slips through, thatpattern
keywords are anchored, thatrequired
is present withproperties
, etc. That is significantly incompatible with the upstream spec though and will complain on a lot of the schemas from the ecosystem.lax
mode disables some of even thedefault
mode coherence checks and is most compatible to the bad decisions in the upstream specification (e.g. ignoring unknown keywords).Currently,
validator
is indefault
mode by default (to be mostly compatible),parser
is instrong
mode by default (as it's a specific feature).Perhaps, for v2, it would make sense to make
validator
configuration stronger by default, e.g. enablingenforceValidation: true
and perhaps some more of thestrong
mode checks.Perhaps some data from the linter usage could help -- it would make sense to run the linter in
strong
mode by default and allow relaxing individual checks.The text was updated successfully, but these errors were encountered: