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

invalid use of oneOf #23

Open
epugh opened this issue Aug 23, 2024 · 0 comments
Open

invalid use of oneOf #23

epugh opened this issue Aug 23, 2024 · 0 comments
Assignees

Comments

@epugh
Copy link
Member

epugh commented Aug 23, 2024

From the JSONSchema community Slack -->

One thing I noticed is invalid use of oneOf on this line. https://github.com/o19s/ubi/blob/main/schema%2F1.0.0%2Fquery.response.schema.json#L11
JSON Schema validation does not evaluate the format keyword to distinguish strings. The format keyword is referred to as an annotation and is only informational.
You might try something like this.

{
  "query_id": { 
    "type": "string",
    "oneOf":[
      { "pattern": "pattern for <uuid>"},
      {"not":{ "pattern": "pattern for <uuid>", "maxLength": 100}}
    ]
  }
}
@epugh epugh self-assigned this Aug 29, 2024
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