We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Draft 7 of JSON Schema addes Keywords for Applying Subschemas Conditionally.
It would be amazing to add support for if/then/else to liform-react. e.g.:
schema:
{ "properties": { "power": { "type": "integer" } }, "if": { "properties": { "power": { "const": 9000 } } }, "then": { "properties": { "disbelief": { "type": "boolean" } } }, "else": { "properties": { "confidence": { "type": "string" } } } }
data 1:
{ "power": 12 }
form 1:
<form> <label for="field-power">power</label> <input id="field-power" type="number" step="1"/> <label for="field-disbelief">disbelief</label> <input id="field-disbelief" type="checkbox"/> </form>
data 2:
{ "power": 42000 }
<form> <label for="field-power">power</label> <input id="field-power" type="number" step="1"/> <label for="field-confidence">confidence</label> <input id="field-confidence" type="text"/> </form>
Basically, if the if schema is valid then the then schema is applied, otherwise the else schema is applied (if else is defined).
if
then
else
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Draft 7 of JSON Schema addes Keywords for Applying Subschemas Conditionally.
It would be amazing to add support for if/then/else to liform-react. e.g.:
schema:
data 1:
form 1:
data 2:
form 1:
Basically, if the
if
schema is valid then thethen
schema is applied, otherwise theelse
schema is applied (ifelse
is defined).The text was updated successfully, but these errors were encountered: