Skip to content

Commit

Permalink
Merge pull request #113 from OPENER-next/rework_question_data_structure
Browse files Browse the repository at this point in the history
Rework question data structure
  • Loading branch information
Robbendebiene authored Nov 25, 2022
2 parents 56a7f2a + e9a446a commit 7603233
Show file tree
Hide file tree
Showing 28 changed files with 2,395 additions and 1,426 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/json_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Setup NodeJS
uses: actions/setup-node@v3

- name: Install ajv-cli
run: npm install -g ajv-cli
- name: Setup python
uses: actions/setup-python@v4
- name: Install jsonschema validator
run: pip install jsonschema

- name: Validate questions JSON
run: >
ajv validate
-s assets/datasets/question_catalog_schema.json
-r assets/datasets/osm_condition_schema.json
-d assets/datasets/question_catalog.json
--spec=draft2020
--strict=false
run: jsonschema --instance 'assets/datasets/question_catalog.json' 'assets/datasets/question_catalog_schema.json'

- name: Validate map features JSON
run: >
ajv validate
-s assets/datasets/map_feature_collection_schema.json
-r assets/datasets/osm_condition_schema.json
-d assets/datasets/map_feature_collection.json
--spec=draft2020
--strict=false
run: jsonschema --instance 'assets/datasets/map_feature_collection.json' 'assets/datasets/map_feature_collection_schema.json'
2 changes: 1 addition & 1 deletion assets/datasets/map_feature_collection_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"description": "The icon name/identifier from the custom icons map.",
"type": "string"
},
"conditions": { "$ref": "/assets/datasets/osm_condition_schema.json" }
"conditions": { "$ref": "file:assets/datasets/osm_condition_schema.json" }
}
}
}
1 change: 0 additions & 1 deletion assets/datasets/osm_condition_schema.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$id": "/assets/datasets/osm_condition_schema.json",
"conditions": {
"description": "A list of conditions where one must be met in order to ask this question. (Logical OR)",
"type": "array",
Expand Down
Loading

0 comments on commit 7603233

Please sign in to comment.