Skip to content

Commit

Permalink
Validate series data against JSON schema
Browse files Browse the repository at this point in the history
  • Loading branch information
homeworkprod committed Feb 3, 2024
1 parent ac7f5f7 commit 268e2e7
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.json]
indent_size = 2
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
chmod u+x /usr/local/bin/taplo
- name: Validate party series TOML file
run: taplo lint data/series.toml && taplo format --check data/series.toml
run: taplo lint --schema "file://"$PWD"/schemas/series.json" data/series.toml && taplo format --check data/series.toml

- name: Validate party TOML files
run: |
Expand Down
29 changes: 29 additions & 0 deletions schemas/series.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"title": "LAN party series",
"type": "object",
"properties": {
"series": {
"type": "array",
"items": {
"type": "object",
"properties": {
"slug": {
"type": "string"
},
"name": {
"type": "string"
},
"alternative_names": {
"type": "array",
"items": {
"type": "string"
},
"minItems": 1,
"uniqueItems": true
}
},
"required": ["slug", "name"]
}
}
}
}

0 comments on commit 268e2e7

Please sign in to comment.