json - dependencies is not working in jsonschema validation -


below json schema compatible jsonschema 4.0.

{ "type": "object", "properties": {     "name": { "type": "string" },     "credit_card": {          "type": "number" ,         "id":"credit_card"     },     "billing_address": {         "type": "string" ,         "id":"billing_address"     } }, "required": ["name"], "dependencies": [{     "credit_card": ["billing_address"] }]  } 

dependencies not working there i.e. whenever credit_card details given, generated form should ask billing_address well. fields shown though no validation error shown when credit_card details filled in. enter image description here

we have enabled validation on interaction doing wrong or there version issue. notice haven't specified $schema now.

any helps?

dependencies should not wrapped in array. change dependencies to:

"dependencies": {     "credit_card": ["billing_address"] } 

that make schema valid, no guarantee form generator using supports dependencies keyword. support subset of json schema spec.


Comments