How to conditionally forbid properties based on presence of other properties in JSON Schema?
- 阅读更多 关于 How to conditionally forbid properties based on presence of other properties in JSON Schema?
问题 In my schema I declared these properties: "index_name": { "type": "string", "examples": ["foo-wwen-live", "foo"] }, "locale": { "type": "string", "examples": ["wwen", "usen", "frfr"] }, "environment": { "type": "string", "default": "live", "examples": [ "staging", "edgengram", "test" ] } I want a JSON body validated against my schema to be valid only if : index_name is present, and both locale and environment are not present; locale and/or enviroment are present, and index_name is not present