Conversation
Added JSON schema for SmartCompanion Audioguide data structure, detailing required properties and definitions for assets, stations, languages, texts, tours, pins, and server configurations.
Move example data into examples/ directory, add JSON schema validation step to GitHub Pages workflow, update README with links to hosted examples and schema documentation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Split workflow into validate and deploy jobs so validation runs on every push and PR, while deployment only happens on pushes to main. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Introduces a formal JSON Schema for the SmartCompanion audioguide data.json format, adds example datasets, and sets up CI + GitHub Pages to validate and publish human-readable schema documentation.
Changes:
- Added
schema.json(JSON Schema draft 2020-12) describing the data format. - Added example
data.jsonfiles underexamples/(animals, leon). - Reworked README to point to the generated schema docs and direct example links; added Pages workflow for validation + publishing.
Reviewed changes
Copilot reviewed 3 out of 50 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
schema.json |
Defines the JSON Schema for audioguide data (assets, stations, languages, texts, optional tours/pins/server). |
examples/leon/data.json |
Adds a German-only sample dataset intended to validate against the schema. |
examples/animals/data.json |
Adds a multilingual sample dataset intended to validate against the schema. |
README.md |
Replaces the long-form spec with links to the generated schema documentation and hosted examples. |
.github/workflows/pages.yml |
Adds CI validation for examples and GitHub Pages deployment for schema docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Install dependencies | ||
| run: pip install check-jsonschema | ||
|
|
||
| - name: Validate examples | ||
| run: check-jsonschema --schemafile schema.json examples/*/data.json | ||
|
|
||
| deploy: | ||
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
| needs: validate | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: github-pages | ||
| url: ${{ steps.deployment.outputs.page_url }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install dependencies | ||
| run: pip install json-schema-for-humans |
There was a problem hiding this comment.
pip install ... is unpinned for both check-jsonschema and json-schema-for-humans, which can make CI and Pages builds non-reproducible and unexpectedly break when upstream releases change behavior. Consider pinning exact versions (or using a requirements file) and using python -m pip for consistency.
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$id": "https://smartcompanion-app.github.io/data-format/data.schema.json", | ||
| "title": "SmartCompanion Audioguide Data", |
There was a problem hiding this comment.
The schema $id points to .../data.schema.json, but the Pages workflow publishes the file as schema.json (copied verbatim). Tooling that resolves $id (or links to the canonical schema URL) may 404 or treat this as a different schema. Align $id with the published URL, or publish an additional copy at data.schema.json.
| "server": { | ||
| "type": "array", | ||
| "description": "Optional array of IP addresses identifying local servers for downloading data within an internal WiFi network. Enhances download speed for visitors and reduces outbound internet traffic.", | ||
| "items": { | ||
| "type": "string", | ||
| "description": "An IP address of a local server." | ||
| } |
There was a problem hiding this comment.
server is described as containing IP addresses, but the schema currently allows any string. If these values are meant to be validated as IPs, add JSON Schema validation (e.g., format: ipv4/ipv6 via anyOf, or a stricter pattern) so invalid entries are rejected during CI validation.
| pull_request: | ||
| branches: [main] | ||
|
|
||
| permissions: |
There was a problem hiding this comment.
The workflow sets an explicit permissions block but does not grant contents: read. With unspecified permissions defaulting to none, this can break actions/checkout@v4 (and any other step needing repository read access). Add contents: read (or move permissions to the deploy job and keep validate minimal).
| permissions: | |
| permissions: | |
| contents: read |
No description provided.