diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 5794a88..bac13ee 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -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 diff --git a/schemas/party.json b/schemas/party.json new file mode 100644 index 0000000..d763053 --- /dev/null +++ b/schemas/party.json @@ -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" + ] +}