{"id":29543252,"url":"https://github.com/thiagowfx/check-json-schema-meta","last_synced_at":"2026-04-19T05:32:57.117Z","repository":{"id":304173208,"uuid":"1017985528","full_name":"thiagowfx/check-json-schema-meta","owner":"thiagowfx","description":"A pre-commit hook that validates JSON files contain valid $schema references and validates the JSON data against the referenced schema.","archived":false,"fork":false,"pushed_at":"2025-07-26T16:09:06.000Z","size":134,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-26T21:23:00.451Z","etag":null,"topics":["json-schema","json-schema-validator","pre-commit","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiagowfx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-11T12:15:01.000Z","updated_at":"2025-07-26T16:09:10.000Z","dependencies_parsed_at":"2025-07-11T15:20:43.822Z","dependency_job_id":"9667633b-efc1-44b0-adb9-45b18151d97a","html_url":"https://github.com/thiagowfx/check-json-schema-meta","commit_stats":null,"previous_names":["thiagowfx/check-json-schema-meta"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/thiagowfx/check-json-schema-meta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagowfx%2Fcheck-json-schema-meta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagowfx%2Fcheck-json-schema-meta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagowfx%2Fcheck-json-schema-meta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagowfx%2Fcheck-json-schema-meta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagowfx","download_url":"https://codeload.github.com/thiagowfx/check-json-schema-meta/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagowfx%2Fcheck-json-schema-meta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272467850,"owners_count":24939633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["json-schema","json-schema-validator","pre-commit","python"],"created_at":"2025-07-17T13:41:55.484Z","updated_at":"2026-04-19T05:32:57.110Z","avatar_url":"https://github.com/thiagowfx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# check-json-schema-meta\n\n[![Pytest](https://github.com/thiagowfx/check-json-schema-meta/actions/workflows/pytest.yml/badge.svg)](https://github.com/thiagowfx/check-json-schema-meta/actions/workflows/pytest.yml)\n\nA pre-commit hook that validates JSON files contain valid `$schema` references and validates the JSON data against the referenced schema.\n\n\u003e **Note**: This repository serves as a workaround for [python-jsonschema/check-jsonschema#310](https://github.com/python-jsonschema/check-jsonschema/issues/310) - a feature request to add validation of `$schema` references in JSON files.\n\n## Features\n\n- Validates that JSON files contain a `$schema` key (gracefully skips by default)\n- Loads and validates the referenced JSON Schema (supports both local files and URLs)\n- Validates JSON data against the schema\n- `--strict` flag to make missing `$schema` fail validation\n- `--expand-env-vars` flag to enable environment variable expansion in `$schema` paths (e.g. `\"${SCHEMA_DIR}/my-schema.json\"`)\n- Exits with non-zero code on errors but checks all files before exiting\n- Integrates with pre-commit hooks\n\n## Installation\n\n1. Install dependencies:\n   ```bash\n   uv sync\n   ```\n\n2. Add to your `.pre-commit-config.yaml`:\n   ```yaml\n   repos:\n     - repo: https://github.com/thiagowfx/check-json-schema-meta\n       rev: main\n       hooks:\n         - id: check-json-schema-meta\n   ```\n\n## Usage\n\n### Pre-commit Hook Usage\n\nOne-shot preview (trial):\n\n```shell\nprek try-repo https://github.com/thiagowfx/check-json-schema-meta check-json-schema-meta --all\n```\n\nBasic configuration in `.pre-commit-config.yaml`:\n\n```yaml\nrepos:\n  - repo: https://github.com/thiagowfx/check-json-schema-meta\n    rev: main  replace with the latest tag\n    hooks:\n      - id: check-json-schema-meta\n```\n\nWith strict mode enabled:\n\n```yaml\nrepos:\n  - repo: https://github.com/thiagowfx/check-json-schema-meta\n    rev: main  # replace with the latest tag\n    hooks:\n      - id: check-json-schema-meta\n        args: ['--strict']\n```\n\nWith environment variable expansion enabled:\n\n```yaml\nrepos:\n  - repo: https://github.com/thiagowfx/check-json-schema-meta\n    rev: main  # replace with the latest tag\n    hooks:\n      - id: check-json-schema-meta\n        args: ['--expand-env-vars']\n```\n\nRun prek hooks:\n\n```bash\n# Install prek hooks\nprek install\n\n# Run only this specific hook\nprek run [--all-files] check-json-schema-meta\n```\n\n### Direct Usage\n\n```bash\n# Default behavior - gracefully skip files without $schema\nuv run check-json-schema-meta file1.json file2.json\n\n# Strict mode - fail on missing $schema\nuv run check-json-schema-meta --strict file1.json file2.json\n```\n\n### Options\n\n- `--strict`: Make missing `$schema` fail validation. By default, files without `$schema` are gracefully skipped.\n- `--expand-env-vars`: Expand environment variables in `$schema` paths.\n\n## Development\n\nRun tests:\n\n```bash\nuv run pytest\n```\n\n## Requirements\n\n- Python 3.9+\n- check-jsonschema package\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagowfx%2Fcheck-json-schema-meta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagowfx%2Fcheck-json-schema-meta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagowfx%2Fcheck-json-schema-meta/lists"}