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

handling of not is incorrect in the general case #489

Open
ahl opened this issue Jan 20, 2024 · 0 comments
Open

handling of not is incorrect in the general case #489

ahl opened this issue Jan 20, 2024 · 0 comments

Comments

@ahl
Copy link
Collaborator

ahl commented Jan 20, 2024

Currently we don't properly handle the general case of not. We do (pretty much) properly address cases such as this:

{
  "allOf": [
    { "$ref": "#/$defs/foo" },
    {
      "not": {
        "required": [ "bar" ]
      }
    }
  ]
}

However, we don't handle

{
  "allOf": [
    { "$ref": "#/$defs/foo" },
    {
      "not": {
        "required": [ "bar", "baz" ]
      }
    }
  ]
}

We also don't handle properties in the not schema.

We can think of the various components of a not schema as independent constraints. So if a not schema contains independent constraints X, Y, and Z, we could rewrite that as not: allOf: [X, Y Z]. Then we can transform that into anyOf: [ not: X, not: Y, not: Z]. While we don't currently properly handle anyOf(see #414), once we do, that will turn into aoneOf` power set of those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant