conditional subschemas (writing conditions inside a JSON Schema)
Following keywords are used to implement conditional schema, which means validation of JSON will be happening with some defined condition. All these keywords work together to implement the conditional application of a subschema based on the outcome of another subschema. These keywords must not interact with each other across subschema boundaries. In other words, an "if" in one branch of an "allOf" must not have an impact on a "then" or "else" in another branch. There is no default behavior for any of these keywords when they are not present. In particular, they must not be treated as if present with an empty schema, and when "if" is not present, both "then" and "else" must be entirely ignored. if : This keyword's value must be a valid JSON Schema. This keyword's subschema has no direct effect on the overall validation result. Rather, it controls which of the "then" or "else" key