Skip to content

Commit

Permalink
Validate party data against JSON schema
Browse files Browse the repository at this point in the history
  • Loading branch information
homeworkprod committed Feb 4, 2024
1 parent c385fc2 commit 34e1f9d
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
- name: Validate party TOML files
run: |
shopt -s globstar
taplo lint data/parties/**/*.toml && taplo format --check data/parties/**/*.toml
taplo lint --schema "file://"$PWD"/schemas/party.json" data/parties/**/*.toml && taplo format --check data/parties/**/*.toml
76 changes: 76 additions & 0 deletions schemas/party.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"title": "LAN party",
"type": "object",
"properties": {
"slug": {
"type": "string"
},
"title": {
"type": "string"
},
"series_slug": {
"type": "string"
},
"organizer_entity": {
"type": "string"
},
"start_on": {
"type": "string"
},
"end_on": {
"type": "string"
},
"seats": {
"type": "integer",
"minimum": 2
},
"location": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"country_code": {
"type": "string"
},
"city": {
"type": "string"
},
"zip_code": {
"type": "string"
},
"street": {
"type": "string"
},
"latitude": {
"type": "number"
},
"longitude": {
"type": "number"
}
},
"required": [
"name",
"country_code",
"city"
]
},
"links": {
"type": "object",
"properties": {
"website": {
"type": "string"
}
},
"required": [
"website"
]
}
},
"required": [
"slug",
"title",
"start_on",
"end_on"
]
}

0 comments on commit 34e1f9d

Please sign in to comment.