8000 Cfgu enum type is always required · Issue #687 · configu/configu · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cfgu enum type is always required #687

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

Open
davidmeirlevy opened this issue Dec 25, 2024 · 0 comments
Open

Cfgu enum type is always required #687

davidmeirlevy opened this issue Dec 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@davidmeirlevy
Copy link
Contributor
davidmeirlevy commented Dec 25, 2024

Current Behavior

  1. create a cfgu file.

  2. add a key with enum: [...any values you wish]

  3. validate the cfgu with an empty object.

  4. try to explicitly add required: false

Expected Behavior

The key is not required, so an empty value should be valid.

To Reproduce

  1. create a cfgu file.

  2. add a key with enum: [...any values you wish]

  3. validate the cfgu with an empty object. -> should be valid.

  4. try to explicitly add required: false. -> should be valid.

Context

Seems like required: false is ignored, even when we explicitly mention it.

JSONSchema supports enum not to be required.
For example, check this schema:

{
 "type": "object",
 "properties": {
   "a": {"type": "string", "enum": ["a","b"]}  
 }
}

an empty object is a valid value for this schema.

@davidmeirlevy davidmeirlevy added the bug Something isn't working label Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant
0