Skip to content

Figure out a reasonable default configuration for v2.0.0 #129

@ChALkeR

Description

@ChALkeR

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 (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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions