Skip to content

Commit

Permalink
Merge pull request #100 from VladimirKuletski/master
Browse files Browse the repository at this point in the history
JSON schema check
  • Loading branch information
Berny23 committed Dec 21, 2022
2 parents 6a1aa86 + 3cbc480 commit 06c077f
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,18 @@ jobs:
# - run: npm run build --if-present
# - run: npm test

verify-json-validation:

runs-on: ubuntu-latest

strategy:
matrix:
file-name: [charactermap, tokenmap]

steps:
- uses: actions/checkout@v3
- name: Validate JSON ${{ matrix.file-name }}.json
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: /test/${{ matrix.file-name }}_schema.json
INPUT_JSONS: /server/json/${{ matrix.file-name }}.json
30 changes: 30 additions & 0 deletions test/charactermap_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"type": "array",
"title": "Root Schema",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "object",
"title": "A Schema",
"minProperties": 4,
"additionalProperties": false,
"properties": {
"id": {
"type": "integer",
"title": "The id Schema"
},
"name": {
"type": "string",
"title": "The name Schema"
},
"world": {
"type": "string",
"title": "The world Schema"
},
"abilities": {
"type": "string",
"title": "The abilities Schema"
}
}
}
}
38 changes: 38 additions & 0 deletions test/tokenmap_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"type": "array",
"title": "Root Schema",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "object",
"title": "A Schema",
"minProperties": 6,
"additionalProperties": false,
"properties": {
"id": {
"type": "integer",
"title": "The id Schema"
},
"upgrademap": {
"type": "integer",
"title": "The upgrademap Schema"
},
"rebuild": {
"type": "integer",
"title": "The rebuild Schema"
},
"name": {
"type": "string",
"title": "The name Schema"
},
"world": {
"type": "string",
"title": "The world Schema"
},
"abilities": {
"type": "string",
"title": "The abilities Schema"
}
}
}
}

0 comments on commit 06c077f

Please sign in to comment.