Skip to content

Commit 665abee

Browse files
docs(jsonschema): add error_details json schema and docs around them
1 parent ee0452e commit 665abee

3 files changed

Lines changed: 63 additions & 0 deletions

File tree

docs/advanced_guidance/json_schemas.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ For autocomplete support in VS Code, you can alter the `.vscode/settings.json` a
1717
],
1818
"url": "./json_schemas/dataset.schema.json"
1919
},
20+
{
21+
"fileMatch": [
22+
"*_data_contract_error_details.json"
23+
],
24+
"url": "./json_schemas/contract/error_details.schema.json"
25+
},
2026
{
2127
"fileMatch": [
2228
"*.rulestore.json",

docs/advanced_guidance/json_schemas/contract/contract.schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
"additionalProperties": {
2626
"$ref": "components/readable_entity.schema.json"
2727
}
28+
},
29+
"error_details": {
30+
"description": "Relative path from the dischema document to reference a error details document.",
31+
"type": "string"
2832
}
2933
},
3034
"additionalProperties": true
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "data-ingest:error_details.schema.json",
4+
"title": "Data Contract Error Details",
5+
"type": "object",
6+
"patternProperties": {
7+
".*": {
8+
"type": "object",
9+
"description": "Name of the field defined within the data contract entities.",
10+
"properties": {
11+
"Bad value": {
12+
"$ref": "#/$defs/errorObject",
13+
"description": "When a value is incompatiable. e.g. trying to cast 'hello' as int."
14+
},
15+
"Blank": {
16+
"$ref": "#/$defs/errorObject",
17+
"description": "When a mandatory value is missing."
18+
}
19+
}
20+
}
21+
},
22+
"$defs": {
23+
"errorObject": {
24+
"type": "object",
25+
"properties": {
26+
"error_code": {
27+
"type": "string",
28+
"description": "The code you want to report in the error report."
29+
},
30+
"error_message": {
31+
"type": "string",
32+
"description": "The error message you want to report in the error report."
33+
},
34+
"error_level": {
35+
"type": "string",
36+
"description": "Whether the error should be a record rejection or file/submission rejection. Defaulted to record.",
37+
"enum": [
38+
"record",
39+
"submission"
40+
]
41+
},
42+
"is_informational": {
43+
"type": "boolean",
44+
"description": "Whether to raise the error as a warning or not. Defaulted to false."
45+
},
46+
"reporting_entity": {
47+
"type": "string",
48+
"description": "Whether to rename the entity shown in the error report. Defaults to the entity name in the dischema."
49+
}
50+
}
51+
}
52+
}
53+
}

0 commit comments

Comments
 (0)