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

Conditional required rule #981

Closed
kris2214 opened this issue Jul 19, 2018 · 1 comment
Closed

Conditional required rule #981

kris2214 opened this issue Jul 19, 2018 · 1 comment

Comments

@kris2214
Copy link

Consider I have a json schema as below:
....
{
"properties" : {
"minimumDelay" : {
"type" : "number"
},
"length" : {
"type" : "number"
},
},
"required": {
"minimumDelay",
"length"
}

Here the json data will be valid if I enter both minimumDelay and length values.

But my requirement is json data must be valid when I enter either 1 of the values(like XOR case). How my schema must be modified to achieve the same?

@Anthropic
Copy link
Member

This would be handled with oneOf validation which isn't currently supported without making a basic add-on to provide it.

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