Skip to content

update output's nested to details & basic to list #1351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions jsonschema-core.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,7 @@
with no further details.
</t>
<t>
Basic - Provides validation information in a flat list structure.
List - Provides validation information in a flat list structure.
</t>
<t>
Hierarchical - Provides validation information in a hierarchical
Expand All @@ -2815,7 +2815,7 @@
</t>
</list>
An implementation MUST provide the "flag" format and SHOULD provide at least one
of the "basic" or "hierarchical" formats. Implementations SHOULD specify in
of the "list" or "hierarchical" formats. Implementations SHOULD specify in
their documentation which formats they support.
</t>

Expand Down Expand Up @@ -2974,30 +2974,30 @@ https://example.com/schemas/common#/$defs/allOf/1
</t>
</section>

<section title="Nested Results">
<section title="Results from Subschemas">
<t>
Nested results are generated from keywords which create a new dynamic
scope by applying a subschema to the instance or a child of the instance.
Evaluation results generated by applying a subschema to the instance
or a child of the instance.
Keywords which have multiple subschemas (e.g. "anyOf") will generally
generate an output unit for each subschema. In order to accommodate
potentially multiple results, the value of this property MUST be an
array of output units, even if only a single output unit is produced.
</t>
<t>
For "basic", this property will appear only at the root output unit
For "list", this property will appear only at the root output unit
and will hold all output units in a flat list.
</t>
<t>
For "hierarchical", this property will hold nested results in a tree
structure where each output unit may itself have nested results.
For "hierarchical", this property will contain results in a tree
structure where each output unit may itself have further nested results.
</t>
<t>
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.
</t>
<t>
The JSON key for nested results is "nested".
The JSON key for these additional results is "details".
</t>
</section>

Expand All @@ -3007,13 +3007,13 @@ https://example.com/schemas/common#/$defs/allOf/1
<t>
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
"nested" as described below.
"details" as described below.
<list>
<t>
"valid" - a boolean value indicating the overall validation success or failure
</t>
<t>
"nested" - the collection of results produced by subschemas
"details" - the collection of results produced by subschemas
</t>
</list>
For these examples, the following schema and instances will be used.
Expand Down Expand Up @@ -3201,17 +3201,17 @@ https://example.com/schemas/common#/$defs/allOf/1
</t>
</section>

<section title="Basic">
<section title="List">
<t>
The "Basic" structure is a flat list of output units contained within a
The "List" structure is a flat list of output units contained within a
root output unit.
</t>
<t>
The root output unit contains "valid" for the overall result and "nested"
The root output unit contains "valid" for the overall result and "details"
for the list of specific results. All other information is explicitly
omitted from the root output unit. If the root schema produces errors or
annotations, then the output node for the root MUST be present within the
root output unit's "nested" list with those errors or annotations.
root output unit's "details" list with those errors or annotations.
</t>
<t>
Output units which do not contain errors or annotations SHOULD be excluded
Expand All @@ -3224,7 +3224,7 @@ https://example.com/schemas/common#/$defs/allOf/1
// failing results
{
"valid": false,
"nested": [
"details": [
{
"valid": false,
"evaluationPath": "/properties/foo/allOf/0",
Expand Down Expand Up @@ -3258,7 +3258,7 @@ https://example.com/schemas/common#/$defs/allOf/1
// passing results
{
"valid": true,
"nested": [
"details": [
{
"valid": true,
"evaluationPath": "",
Expand Down Expand Up @@ -3346,13 +3346,13 @@ https://example.com/schemas/common#/$defs/allOf/1
"evaluationPath": "",
"schemaLocation": "https://json-schema.org/schemas/example#",
"instanceLocation": "",
"nested": [
"details": [
{
"valid": false,
"evaluationPath": "/properties/foo",
"schemaLocation": "https://json-schema.org/schemas/example#/properties/foo",
"instanceLocation": "/foo",
"nested": [
"details": [
{
"valid": false,
"evaluationPath": "/properties/foo/allOf/0",
Expand All @@ -3371,7 +3371,7 @@ https://example.com/schemas/common#/$defs/allOf/1
"properties": [ "foo-prop" ],
"title": "foo-title"
},
"nested": [
"details": [
{
"valid": false,
"evaluationPath": "/properties/foo/allOf/1/properties/foo-prop",
Expand Down Expand Up @@ -3399,7 +3399,7 @@ https://example.com/schemas/common#/$defs/allOf/1
"evaluationPath": "/properties/bar",
"schemaLocation": "https://json-schema.org/schemas/example#/properties/bar",
"instanceLocation": "/bar",
"nested": [
"details": [
{
"valid": false,
"evaluationPath": "/properties/bar/$ref",
Expand All @@ -3409,7 +3409,7 @@ https://example.com/schemas/common#/$defs/allOf/1
"properties": [ "bar-prop" ],
"title": "bar-title"
},
"nested": [
"details": [
{
"valid": false,
"evaluationPath": "/properties/bar/$ref/properties/bar-prop",
Expand Down Expand Up @@ -3442,13 +3442,13 @@ https://example.com/schemas/common#/$defs/allOf/1
"bar"
]
},
"nested": [
"details": [
{
"valid": true,
"evaluationPath": "/properties/foo",
"schemaLocation": "https://json-schema.org/schemas/example#/properties/foo",
"instanceLocation": "/foo",
"nested": [
"details": [
{
"valid": true,
"evaluationPath": "/properties/foo/allOf/0",
Expand All @@ -3469,7 +3469,7 @@ https://example.com/schemas/common#/$defs/allOf/1
"unspecified-prop"
]
},
"nested": [
"details": [
{
"valid": true,
"evaluationPath": "/properties/foo/allOf/1/properties/foo-prop",
Expand All @@ -3494,7 +3494,7 @@ https://example.com/schemas/common#/$defs/allOf/1
"evaluationPath": "/properties/bar",
"schemaLocation": "https://json-schema.org/schemas/example#/properties/bar",
"instanceLocation": "/bar",
"nested": [
"details": [
{
"valid": true,
"evaluationPath": "/properties/bar/$ref",
Expand All @@ -3506,7 +3506,7 @@ https://example.com/schemas/common#/$defs/allOf/1
"bar-prop"
]
},
"nested": [
"details": [
{
"valid": true,
"evaluationPath": "/properties/bar/$ref/properties/bar-prop",
Expand Down
4 changes: 2 additions & 2 deletions output/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

"anyOf": [
{ "$ref": "#/$defs/flag" },
{ "$ref": "#/$defs/basic" },
{ "$ref": "#/$defs/list" },
{ "$ref": "#/$defs/hierarchical" }
],
"$defs": {
Expand Down Expand Up @@ -81,7 +81,7 @@
},
"required": [ "valid" ]
},
"basic": {
"list": {
"properties": {
"valid": { "type": "boolean" },
"nested": {
Expand Down