|
1411 | 1411 |
|
1412 | 1412 | <section title="Keywords for Applying Subschemas Conditionally" anchor="conditional">
|
1413 | 1413 | <t>
|
1414 |
| - These keywords work together to implement conditional |
1415 |
| - application of a subschema based on the outcome of |
1416 |
| - another subschema. |
| 1414 | + Three of these keywords work together to implement conditional |
| 1415 | + application of a subschema based on the outcome of another subschema. |
| 1416 | + The fourth is a shortcut for a specific conditional case. |
1417 | 1417 | </t>
|
1418 | 1418 | <t>
|
1419 |
| - These keywords MUST NOT interact with each other across |
| 1419 | + "if", "then", and "else" MUST NOT interact with each other across |
1420 | 1420 | subschema boundaries. In other words, an "if" in one
|
1421 | 1421 | branch of an "allOf" MUST NOT have an impact on a "then"
|
1422 | 1422 | or "else" in another branch.
|
1423 | 1423 | </t>
|
1424 | 1424 | <t>
|
1425 |
| - There is no default behavior for any of these keywords |
| 1425 | + There is no default behavior for "if", "then", or "else" |
1426 | 1426 | when they are not present. In particular, they MUST NOT
|
1427 | 1427 | be treated as if present with an empty schema, and when
|
1428 | 1428 | "if" is not present, both "then" and "else" MUST be
|
|
1493 | 1493 | or annotation collection purposes, in such cases.
|
1494 | 1494 | </t>
|
1495 | 1495 | </section>
|
| 1496 | + <section title="dependentSchemas"> |
| 1497 | + <t> |
| 1498 | + This keyword specifies subschemas that are evaluated if the instance |
| 1499 | + is an object and contains a certain property. |
| 1500 | + </t> |
| 1501 | + <t> |
| 1502 | + This keyword's value MUST be an object. |
| 1503 | + Each value in the object MUST be a valid JSON Schema. |
| 1504 | + </t> |
| 1505 | + <t> |
| 1506 | + If the object key is a property in the instance, the entire |
| 1507 | + instance must validate against the susbschema. Its use is |
| 1508 | + dependent on the presence of the property. |
| 1509 | + </t> |
| 1510 | + <t> |
| 1511 | + Omitting this keyword has the same behavior as an empty object. |
| 1512 | + </t> |
| 1513 | + </section> |
1496 | 1514 | </section>
|
1497 | 1515 | </section>
|
1498 | 1516 | <section title="Keywords for Applying Subschemas to Child Instances">
|
|
1690 | 1708 | Omitting this keyword has the same behavior as an empty schema.
|
1691 | 1709 | </t>
|
1692 | 1710 | </section>
|
1693 |
| - |
1694 |
| - <section title="dependencies"> |
1695 |
| - <t> |
1696 |
| - This keyword specifies subschemas that are evaluated if the instance |
1697 |
| - is an object and contains a certain property. |
1698 |
| - </t> |
1699 |
| - <t> |
1700 |
| - This keyword's value MUST be an object. |
1701 |
| - Each value in the object MUST be a valid JSON Schema. |
1702 |
| - </t> |
1703 |
| - <t> |
1704 |
| - If the object key is a property in the instance, the entire |
1705 |
| - instance must validate against the dependency value. |
1706 |
| - </t> |
1707 |
| - <t> |
1708 |
| - Omitting this keyword has the same behavior as an empty object. |
1709 |
| - </t> |
1710 |
| - </section> |
1711 | 1711 | </section>
|
1712 | 1712 | </section>
|
1713 | 1713 | </section>
|
@@ -2048,7 +2048,7 @@ User-Agent: product-name/5.4.1 so-cool-json-schema/1.0.2 curl/7.43.0
|
2048 | 2048 | <list style="symbols">
|
2049 | 2049 | <t>Moved "definitions" from the Validation specification here as "$defs"</t>
|
2050 | 2050 | <t>Moved applicator keywords from the Validation specification as their own vocabulary</t>
|
2051 |
| - <t>Moved "dependencies" from the Validation specification, but only the schema form</t> |
| 2051 | + <t>Moved the schema form of "dependencies" from the Validation specification as "dependentSchemas"</t> |
2052 | 2052 | </list>
|
2053 | 2053 | </t>
|
2054 | 2054 | <t hangText="draft-handrews-json-schema-01">
|
|
0 commit comments