Skip to content
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

Update output schema to describe new structure #1285

Merged
merged 1 commit into from
Oct 17, 2022
Merged
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
68 changes: 28 additions & 40 deletions output/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,75 +6,56 @@
"anyOf": [
{ "$ref": "#/$defs/flag" },
{ "$ref": "#/$defs/basic" },
{ "$ref": "#/$defs/detailed" },
{ "$ref": "#/$defs/verbose" }
{ "$ref": "#/$defs/hierarchical" }
],
"$defs": {
"outputUnit":{
"properties": {
"valid": { "type": "boolean" },
"keywordLocation": {
"evaluationPath": {
"type": "string",
"format": "json-pointer"
},
"absoluteKeywordLocation": {
"schemaLocation": {
"type": "string",
"format": "uri"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be iri now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see you're already on it, re the other PR about uri->iri changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to push this forward as I can't wait on your PR any longer. It needs to be rebased anyway.

},
"instanceLocation": {
"type": "string",
"format": "json-pointer"
},
"error": {
"type": "string"
},
"errors": {
"nested": {
"$ref": "#/$defs/outputUnitArray"
},
"annotations": {
"$ref": "#/$defs/outputUnitArray"
"type": "object",
"additionalProperties": true
},
"errors": {
"type": "object",
"additionalProperties": { "type": "string" }
}
},
"required": [ "valid", "keywordLocation", "instanceLocation" ],
"required": [ "valid", "evaluationPath", "schemaLocation", "instanceLocation" ],
"allOf": [
{
"if": {
"required": [ "errors" ]
},
"then": {
"properties": {
"valid": { "const": false }
}
},
"then": {
"anyOf": [
{
"required": [ "error" ]
},
{
"required": [ "errors" ]
}
]
}
},
{
"if": {
"anyOf": [
{
"properties": {
"keywordLocation": {
"pattern": "/\\$ref/"
}
}
},
{
"properties": {
"keywordLocation": {
"pattern": "/\\$dynamicRef/"
}
}
}
]
"required": [ "annotations" ]
},
"then": {
"required": [ "absoluteKeywordLocation" ]
"properties": {
"valid": { "const": true }
}
}
}
]
Expand All @@ -89,8 +70,15 @@
},
"required": [ "valid" ]
},
"basic": { "$ref": "#/$defs/outputUnit" },
"detailed": { "$ref": "#/$defs/outputUnit" },
"verbose": { "$ref": "#/$defs/outputUnit" }
"basic": {
"properties": {
"valid": { "type": "boolean" },
"nested": {
"$ref": "#/$defs/outputUnitArray"
}
},
"required": [ "valid", "nested" ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the 'basic' format contain 'nested'? My understanding was that basic is still a flat structure.

Copy link
Member Author

@gregsdennis gregsdennis Sep 11, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basic is an object with only valid and nested at the root. The rest is normal output units in the nested array.

{
  "valid": true,
  "nested": [ <flat list> ]
}

This provides the overall validation result at the root and a flat list. It's the same as 2020-12, except that the location properties aren't required at the root (because they're always just / and redundant).

},
"hierarchical": { "$ref": "#/$defs/outputUnit" }
}
}