support for wildcard in conditional schema dependency
See original GitHub issuePrerequisites
- I have read the documentation;
- In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
- Ideally, I’m providing a sample JSFiddle or a shared playground link demonstrating the issue.
Description
On the conditionals schema dependencies, how can I achieve having the conditional schema be displayed if corresponding enum array “contains” a value. Right now, it seems its only doing equality check and not supporting wildcards “*” etc.
Steps to Reproduce
For eg, in the schema, I have this property
"usageOptions": {
"type": "array",
"title": "Loan Usage Options",
"items": {
"type": "string",
"enum": [
"Other Home Addresses",
"Refinance",
"Home Improvement",
"Education",
"Other"
]
},
"uniqueItems": true
},
And the conditional dependencies schema as
"dependencies": {
"usageOptions": {
"oneOf": [
{
"properties": {
"usageOptions": {
"items": {
"enum": [
"Other"
]
}
},
"othersDes": {
"type": "string",
"title": "Please describe others"
}
}
}
]
}
}
Expected behavior
I want othersDes text field to appear when selected enum values “contains” Other option. So, in the multiple select list, no matter what user selects, if Other is part of selection, then, othersDes text field should display.
Actual behavior
The othersDes text field is appearing when only Other is selected.
Version
latest version “^1.2.0”
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
support for wildcard in conditional schema dependency #1155
On the conditionals schema dependencies, how can I achieve having the conditional schema be displayed if corresponding enum array "contains" a ...
Read more >Applying Subschemas Conditionally - JSON Schema
The dependentSchemas keyword conditionally applies a subschema when a given property is present. This schema is applied in the same way allOf applies...
Read more >Json Schema Conditional Dependency - United Hospital Services
Software foundation is json schema document data is also support json object? To change the dependencies keyword to use schema dependency.
Read more >(PDF) Analyses and Validation of Conditional Dependencies ...
PDF | This paper proposes a natural extension of conditional func- tional dependencies (cfds (14)) and conditional inclusion dependencies ...
Read more >Dependency specification | Documentation | Poetry - Python ...
Wildcard requirements allow for the latest (dependency dependent) version where the wildcard is positioned. * , 1.* and 1.2.* are examples of wildcard...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

You can use the
containskeyword for this: playground linkThank you so much @epicfaace . I used a combination of your suggestions to solve, and works like a charm. Here is how the dependency looks like, for anyone else facing this issue
This will make sure that conditional schema kicks in only when specifically, one if the enum options ( in this case
Otheris included the enum array.