Validating a field depending on another field

21 views
Skip to first unread message

Mauricio de Abreu Antunes

unread,
Jun 1, 2015, 9:22:43 AM6/1/15
to json-...@googlegroups.com
Hello JSON Schema group,

I read the docs and tried a lot of stuff to accomplish the following:

My schema has two fields:

"regex": {
    "type": "boolean"
},
"path": {
    "type": "string"
},

I would like to do something like:

WHEN regex field is "true" it should use JSON Schema "format" validator with "regex" value ("format": "regex").
WHEN regex field is False path will not be format: regex but "string".

I tried to use oneOf but most of the docs represent it validating one field only.
Reply all
Reply to author
Forward
0 new messages