JSON Schema Conditional Statements
问题 I am trying to validate what I thought was a simple JSON schema as a configuration file for my Python application, it's a list of header key/value pairs, the only complication is that if the 'Type' field is set to 'AnyValue' then the value key is not required. Here is the schema as it is: { "definitions": { 'KeyEntry': { "properties": { 'Type': {"type" : "string"}, 'Key': {"type": "string"} }, "required": ['Type', 'Key'], "anyOf": [ { "if": { "properties": {'Type': {"const": 'ExactValue'}} },