https://github.com/thomasmost/gha-valjean
A json schema validator action that supports remote json schemas
https://github.com/thomasmost/gha-valjean
Last synced: 3 months ago
JSON representation
A json schema validator action that supports remote json schemas
- Host: GitHub
- URL: https://github.com/thomasmost/gha-valjean
- Owner: thomasmost
- Created: 2024-06-07T21:10:04.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-01T14:56:46.000Z (over 1 year ago)
- Last Synced: 2025-12-10T04:57:26.588Z (7 months ago)
- Language: TypeScript
- Size: 242 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gha-valjean
A GitHub Action for validating JSON files against a remote schema
On the backend, this uses AJV to perform the validation
## Inputs
### `schema-url`
Url to the remote schema JSON file to validate against
### `target-dir`
Comma-separated list directories to validate
### `all-errors` (optional)
Enables 'all errors' validation on AJV
### `ajv-strict` (optional)
Enables 'strict mode' in AJV
### `draft-version` (optional)
The JSON schema draft version (defaults to 2019)—only supports '2020' and '2019'
## Example Usage
You can use this action to generate artifacts with the type bindings in your preferred languages.
For example, you might design a workflow to generate bindings for both TypeScript and Rust, e.g.
```yml
name: Build
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: API Schema
uses: thomasmost/gha-valjean@0.1.0
with:
schema-url: https://raw.githubusercontent.com/thomasmost/gha-valjean/main/schema/example.schema.json
target-dir: samples
```