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

Generates invalid output using allOf: [{ contains }, { contains }] #727

Open
alanorozco opened this issue Nov 13, 2022 · 1 comment
Open

Comments

@alanorozco
Copy link

alanorozco commented Nov 13, 2022

Schema

The following schema expresses that an array should contain at least ["A", "B"]:

{
  "$schema": "http://json-schema.org/draft-07/schema",
  "type": "array",
  "items": { "type": "string" },
  "allOf": [
    { "contains": { "const": "A" } },
    { "contains": { "const": "B" } }
  ]
}

Expected Result

Any that includes ["A", "B"], and optionally other strings:

["A", "B"]
["aute fugiat", "quis ut", "A", "B"]

Actual Result

Includes only the last item in the allOf.contains list ("B"):

["aute fugiat", "quis ut", "B"]

can't share link since the feature appears to be broken (#726)

@pateketrueke
Copy link
Member

Nice catch, I'll be working on this asap, thank you!

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

2 participants