Skip to content

Commit 9ab1781

Browse files
committed
combine 'output formats' and 'output structure' sections; add conditionally available properties
1 parent 55241ab commit 9ab1781

File tree

1 file changed

+19
-14
lines changed

1 file changed

+19
-14
lines changed

jsonschema-validation-output-machines.md

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ There are no requirements on the form of IRI itself, except that it MUST be abso
1212

1313
JSON Schema output is defined using the JSON Schema data instance model as described in [JSON Schema](#json-schema) "Instance Data Model". Implementations MAY deviate from this in their internal modelling, as supported by their specific languages and platforms, however it is RECOMMENDED that the output be convertible to the JSON format defined herein via serialization or other means.
1414

15-
## Output Formats
16-
17-
This specification defines three output formats. See [Output Structure]{#output-structure} for the requirements of each format.
18-
19-
- **Flag** - A boolean which simply indicates the overall validation result with no further details.
20-
- **List** - Provides validation information in a flat list structure.
21-
- **Hierarchical** - Provides validation information in a hierarchical structure that follows the evaluation paths generated while processing the schema.
15+
## Minimum Information
2216

23-
An implementation MUST provide the "flag" format and SHOULD provide at least one of the "list" or "hierarchical" formats. Implementations SHOULD specify in their documentation which formats they support.
17+
Beyond the simplistic "flag" output, additional information is useful to aid in debugging evaluation of an instance by a schema.
2418

25-
## Minimum Information
19+
The output of a subschema validation is considered an "output unit." The contents of each output unit is specified by this section.
2620

27-
Beyond the simplistic "flag" output, additional information is useful to aid in debugging evaluation of an instance by a schema. Each sub-result MUST contain the [validation result](#validation-result) for the associated subschema as well as the following information defined by [JSON Schema](#json-schema) "Output Formatting".
21+
Each output unit MUST contain the [validation result](#validation-result) for the associated subschema as well as the following information defined by [JSON Schema](#json-schema) "Output Formatting":
2822

2923
- Evaluation Path
3024
- Schema Location
3125
- Instance Location
3226

33-
A single object that contains all of these components is considered an "output unit."
27+
The following information MAY be included conditionally:
28+
29+
- When subschema validation has succeeded
30+
- Annotations
31+
- When subschema validation has failed
32+
- Errors
33+
- Dropped Annotations
3434

3535
Implementations MAY elect to provide additional information.
3636

@@ -50,14 +50,19 @@ For "hierarchical", this property will contain results in a tree structure where
5050

5151
The sequence of output units within this list is not specified and MAY be determined by the implementation. Sets of output units are considered equivalent if they contain the same units, in any order.
5252

53+
<!-- Not sure if it's necessary to mention equivalence. -->
54+
5355
The JSON key for these additional results is `details`.
5456

5557
## Output Structure {#output-structure}
5658

57-
The output MUST be an object containing a boolean property named `valid`. When additional information about the result is required, the output MUST also contain `details` as described below.
59+
This specification defines three output formats.
5860

59-
- `valid` - a boolean value indicating the overall validation success or failure
60-
- `details` - the collection of results produced by subschemas
61+
- **Flag** - A boolean which simply indicates the overall validation result with no further details.
62+
- **List** - Provides validation information in a flat list structure.
63+
- **Hierarchical** - Provides validation information in a hierarchical structure that follows the evaluation paths generated while processing the schema.
64+
65+
An implementation MUST provide the "flag" format and SHOULD provide at least one of the "list" or "hierarchical" formats. Implementations SHOULD specify in their documentation which formats they support.
6166

6267
For these examples, the following schema and instances will be used.
6368

0 commit comments

Comments
 (0)