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

enum incorrectly matches partial string #808

Closed
1 of 4 tasks
erik-carlson opened this issue Aug 11, 2022 · 1 comment
Closed
1 of 4 tasks

enum incorrectly matches partial string #808

erik-carlson opened this issue Aug 11, 2022 · 1 comment

Comments

@erik-carlson
Copy link

Describe the bug

when using enum on a string, partial strings of the enum values are incorrectly marked as valid

schema:

{
  "$schema": "http://json-schema.org/draft-07/schema",
  "type": "object",
  "properties": {
    "foo": {
      "enum": ["bar"]
    }
  }
}

invalid input:

foo: b

valid input:

foo: bar

Expected Behavior

An issue should be identified as the value does not match any of the valid items in enum

Current Behavior

no issue is identified with the invalid input above

Steps to Reproduce

  1. validate the invalid input above with the schema

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)
@msivasubramaniaan
Copy link
Contributor

duplicate of this issue

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