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

Question: dependencies validators #12

Open
justjam2013 opened this issue Oct 25, 2024 · 2 comments
Open

Question: dependencies validators #12

justjam2013 opened this issue Oct 25, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@justjam2013
Copy link

justjam2013 commented Oct 25, 2024

The README says:

  • Note: The contains and dependencies validators are still in development, and do not yet work correctly.

I tried using dependentRequired, before reading the full README, but indeed it didn't work. 🤦

Do you have an idea when development on dependencies validators will be complete?

@zahmo zahmo added the enhancement New feature or request label Oct 27, 2024
@zahmo
Copy link
Owner

zahmo commented Oct 27, 2024

Should hopefully be available in the next release.

@justjam2013
Copy link
Author

Do you have an idea when the next release will be?

BTW, I was able to use oneOf to partially get around the lack of dependencies this way:

          "oneOf": [
            {
              "properties": {
                "fieldA": { "const": "value1" }
              },
              "required": ["field1"]
            },
            {
              "properties": {
                "fieldA": { "const": "value2" }
              },
              "required": ["field2"]
            },
            {
              "properties": {
                "fieldA": { "const": "value3" }
              },
              "required": ["field3"]
            },
            {
              "properties": {
                "fieldA": { "const": "value4" }
              }
            }
          ],

It's a little bit hacky, given that when value4 is selected nothing happens. It just provides a matching placeholder.

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

No branches or pull requests

2 participants