Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/emmanuelgautier/validate-json
A GitHub Action that validates JSON files with JSON Schema.
https://github.com/emmanuelgautier/validate-json
ajv continuous-integration github github-actions json json-schema json-schema-validator
Last synced: about 1 month ago
JSON representation
A GitHub Action that validates JSON files with JSON Schema.
- Host: GitHub
- URL: https://github.com/emmanuelgautier/validate-json
- Owner: emmanuelgautier
- License: mit
- Created: 2024-10-14T07:30:22.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-12-14T17:05:12.000Z (about 2 months ago)
- Last Synced: 2024-12-14T18:19:24.792Z (about 2 months ago)
- Topics: ajv, continuous-integration, github, github-actions, json, json-schema, json-schema-validator
- Language: JavaScript
- Homepage: https://github.com/emmanuelgautier/validate-json
- Size: 1.15 MB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Validate JSON GitHub Action
[![GitHub Super-Linter](https://github.com/emmanuelgautier/validate-json/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter)
![CI](https://github.com/emmanuelgautier/validate-json/actions/workflows/ci.yml/badge.svg)A GitHub Action that validates JSON files with JSON Schema.
## Installation
To use this action, you need to create a workflow file in your repository. For
example, you can create a `.github/workflows/validate-json.yml` file with the
following content:```yaml
name: Validate JSONon:
push:
branches:
- main
pull_request:
branches:
- mainjobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4- name: Validate JSON
uses: emmanuelgautier/validate-json@v1
with:
files: dir/*.json
schema: schema.json
```## Inputs
| Input | Description | Required | Default |
| -------- | ------------------------------------ | -------- | ------- |
| `files` | The JSON file(s) to validate. | `true` | |
| `schema` | The JSON Schema to validate against. | `false` | |
| `strict` | Enforce strict validation. | `false` | `false` |## Outputs
| Output | Description |
| ------- | ----------------------------------- |
| `valid` | Whether the JSON file(s) are valid. |## About
This action uses [ajv](https://ajv.js.org/) to validate JSON files.
## License
The action in this repository is licensed under the
[MIT License](https://github.com/emmanuelgautier/validate-json/blob/main/LICENSE)@
[Emmanuel Gautier](https://www.emmanuelgautier.com/).