@@ -1561,6 +1561,35 @@ behave correctly under implementations that attempt to use any reference target
1561
1561
as a schema. However, this behavior is implementation-specific and MUST NOT be
1562
1562
relied upon for interoperability.
1563
1563
1564
+ #### Failure to resolve references
1565
+
1566
+ If for any reason a reference cannot be resolved, the evaluation MUST halt and
1567
+ return an indeterminant result. Specifically, it MUST NOT return a passing or
1568
+ failing validation result or any annotations. Instead it MUST inform the
1569
+ consuming application or user of the evaluation failure via other means. It is
1570
+ RECOMMENDED that implementations utilize native functionality for this purpose,
1571
+ such as, but not limited to, raising an exception or other error.
1572
+
1573
+ In the cases where optimizations are enabled and a schema containing a
1574
+ non-resolvable reference would be skipped, as in the example below, behavior is
1575
+ implementation-defined.
1576
+
1577
+ ``` json
1578
+ {
1579
+ "anyOf" : [
1580
+ true ,
1581
+ { "$ref" : " https://json-schema.org/does-not-exist" }
1582
+ ]
1583
+ }
1584
+ ```
1585
+
1586
+ Here, an optimized evaluation may recognize that ` /anyOf/0 ` will satisfy the
1587
+ ` anyOf ` constraint, regardless of the validation result of ` /anyOf/1 ` , and so
1588
+ ` /anyOf/1 ` may be skipped altogether.
1589
+
1590
+ However, an unoptimized evaluation of this schema (for example one that expects
1591
+ all annotation results), would result in a resolution failure.
1592
+
1564
1593
### Associating Instances and Schemas
1565
1594
1566
1595
#### Usage for Hypermedia {#hypermedia}
0 commit comments