Psedo-code scenario: ``` if (drink.name == 'beer' || drink.name == 'wine') // "color" is a required fiels else if (drink.name == "water") // nothing is required ``` Maybe i'm wrong but I can't find a way to implement this case, `dependencies` keyword seems to work on `key` **presence** but not on `key` **value**. ``` { "type": "object", "properties": { "name": { "type": "string", "enum": ["beer", "wine", "water"] }, "color" : { "type": "string" } }, "required": ["name"], "dependencies": { "name": ["color"] // I can't specify the value of name } } ``` With the current **draft** is it possible to implement logic with this meaning? ``` "dependencies" : { "name": { "beer": ["color"], "wine": ["color"] } } ``` Or a less redundant way like this: ``` required: [ "name", {"color": { "name": {"anyOf": ["beer", "wine"] } }} ] ```
Psedo-code scenario:
Maybe i'm wrong but I can't find a way to implement this case,
dependencieskeyword seems to work onkeypresence but not onkeyvalue.With the current draft is it possible to implement logic with this meaning?
Or a less redundant way like this: