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