Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ChALkeR opened this issue Jul 22, 2020 · 0 comments
Open

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

ChALkeR opened this issue Jul 22, 2020 · 0 comments
Assignees
Milestone

Comments

@ChALkeR
Copy link
Contributor

ChALkeR commented Jul 22, 2020

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.

@ChALkeR ChALkeR added this to the v2.0.0 milestone Jul 22, 2020
@ChALkeR ChALkeR self-assigned this Jul 22, 2020
@ChALkeR ChALkeR added the future label Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant