Skip to content

Feat json schema#1

Merged
stefanhuber merged 3 commits intomainfrom
feat-json-schema
Mar 7, 2026
Merged

Feat json schema#1
stefanhuber merged 3 commits intomainfrom
feat-json-schema

Conversation

@stefanhuber
Copy link
Copy Markdown
Member

No description provided.

stefanhuber and others added 3 commits March 1, 2026 21:08
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>
Copilot AI review requested due to automatic review settings March 7, 2026 17:49
@stefanhuber stefanhuber merged commit 0371881 into main Mar 7, 2026
3 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json files under examples/ (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.

Comment on lines +18 to +35
- 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
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +4
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://smartcompanion-app.github.io/data-format/data.schema.json",
"title": "SmartCompanion Audioguide Data",
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +61 to +67
"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."
}
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
pull_request:
branches: [main]

permissions:
Copy link

Copilot AI Mar 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
permissions:
permissions:
contents: read

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants