Skip to content

Commit d561143

Browse files
committed
ensure the required properties are not empty
Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz>
1 parent d410f6a commit d561143

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

schema_1.0.0.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"schema_version": {
1111
"description": "Required, schema version of the current document.",
1212
"id": "/properties/header/properties/api_version",
13-
"type": "string"
13+
"type": "string",
14+
"minLength": 1
1415
},
1516
"comments": {
1617
"description": "Optional, additional information for the spectral dataset.",
@@ -20,7 +21,8 @@
2021
"description": {
2122
"description": "Required, description of the spectral dataset.",
2223
"id": "/properties/header/properties/description",
23-
"type": "string"
24+
"type": "string",
25+
"minLength": 1
2426
},
2527
"document_creation_date": {
2628
"description": "Required, document creation date expressed as per RFC 3339 - Date and Time on the Internet: Timestamps, e.g. 2017-01-01T12:00:00Z.",
@@ -31,7 +33,8 @@
3133
"document_creator": {
3234
"description": "Required, creator of the document, e.g. company, individual, laboratory, etc.",
3335
"id": "/properties/header/properties/document_creator",
34-
"type": "string"
36+
"type": "string",
37+
"minLength": 1
3538
},
3639
"laboratory": {
3740
"description": "Optional, laboratory or company that performed the measurements.",
@@ -41,7 +44,8 @@
4144
"license": {
4245
"description": "Required, usage license of the document, e.g. CC-BY-NC-ND",
4346
"id": "/properties/header/properties/license",
44-
"type": "string"
47+
"type": "string",
48+
"minLength": 1
4549
},
4650
"manufacturer": {
4751
"description": "Optional, manufacturer of the device being tested.",
@@ -70,6 +74,7 @@
7074
}
7175
},
7276
"required": [
77+
"schema_version",
7378
"description",
7479
"document_creation_date",
7580
"document_creator",

scripts/check_schema.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ error=0
55
for DIR in camera cmf illuminant training; do
66
for FILE in ./data/$DIR/*; do
77
echo "Processing file $FILE"
8-
if ! check-jsonschema --schemafile ./schema_0.1.0.json $FILE; then
8+
if ! check-jsonschema --schemafile ./schema_1.0.0.json $FILE; then
99
error=1
1010
fi
1111
done

0 commit comments

Comments
 (0)