Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 361cec1

Browse files
Merge pull request #1439 from json-schema-org/gregsdennis/failed-$ref-resolution
add section to specify behavior for failed reference resolution
2 parents 50893ed + d42581c commit 361cec1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

‎jsonschema-core.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,6 +1578,35 @@ behave correctly under implementations that attempt to use any reference target
15781578
as a schema. However, this behavior is implementation-specific and MUST NOT be
15791579
relied upon for interoperability.
15801580

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+
15811610
### Associating Instances and Schemas
15821611

15831612
#### Usage for Hypermedia {#hypermedia}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /