Skip to content

Add CI check to validate JSON files in schema/ on pull requests#33

Merged
rajeshsindhu merged 4 commits into
mainfrom
copilot/add-json-validation-check
Mar 2, 2026
Merged

Add CI check to validate JSON files in schema/ on pull requests#33
rajeshsindhu merged 4 commits into
mainfrom
copilot/add-json-validation-check

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

No automated validation existed for JSON files added to the schema/ directory, making it easy to merge malformed files silently.

Changes

.github/workflows/validate-json.yml

  • Triggers on PRs touching schema/**
  • Runs the validation script and fails the check on any malformed file
  • Scoped to permissions: contents: read

.github/scripts/validate_json.py

  • Recursively validates all *.json files under a given directory (default: schema/)
  • Uses Python's built-in json.load() with proper resource handling
  • Emits per-file VALID/INVALID output with exact parse error location; exits non-zero on any failure
VALID: schema/event_schema.json
VALID: schema/event_transaction.json
INVALID: schema/broken.json — Expecting value: line 3 column 5 (char 42)

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: rajeshsindhu <24849791+rajeshsindhu@users.noreply.github.com>
Copilot AI changed the title [WIP] Add check for valid JSON format in schema directory Add CI check to validate JSON files in schema/ on pull requests Mar 2, 2026
@rajeshsindhu rajeshsindhu marked this pull request as ready for review March 2, 2026 21:44
@rajeshsindhu rajeshsindhu requested a review from Copilot March 2, 2026 21:44
Copy link
Copy Markdown
Contributor

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

Adds a pull-request CI gate to ensure JSON files under schema/ are syntactically valid, preventing malformed JSON from being merged unnoticed.

Changes:

  • Introduces a GitHub Actions workflow that runs on PRs affecting schema/**.
  • Adds a Python script that recursively parses *.json files and fails CI on any decode errors.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/validate-json.yml New PR workflow to run JSON validation when schema/** changes.
.github/scripts/validate_json.py New validator script that walks schema/ and checks JSON parseability.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/validate-json.yml
Comment thread .github/scripts/validate_json.py Outdated
rajeshsindhu and others added 2 commits March 2, 2026 14:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@rajeshsindhu rajeshsindhu merged commit b68349a into main Mar 2, 2026
3 checks passed
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.

4 participants