{"id":18586373,"url":"https://github.com/cardinalby/schema-validator-action","last_synced_at":"2025-04-10T13:32:04.626Z","repository":{"id":61740698,"uuid":"442570293","full_name":"cardinalby/schema-validator-action","owner":"cardinalby","description":"JSON Schema validator Action","archived":false,"fork":false,"pushed_at":"2024-06-27T20:01:20.000Z","size":1101,"stargazers_count":15,"open_issues_count":5,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T21:42:37.447Z","etag":null,"topics":["json-schema","schema","schemasafe","validation","validator","yaml"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cardinalby.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}},"created_at":"2021-12-28T19:58:57.000Z","updated_at":"2024-11-26T15:47:09.000Z","dependencies_parsed_at":"2024-11-07T00:41:54.271Z","dependency_job_id":"5400294d-25dd-477c-8218-42513819823f","html_url":"https://github.com/cardinalby/schema-validator-action","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":"0.19999999999999996","last_synced_commit":"064df28b0382ab3da1675e24605954d2d3a56626"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardinalby%2Fschema-validator-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardinalby%2Fschema-validator-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardinalby%2Fschema-validator-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cardinalby%2Fschema-validator-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cardinalby","download_url":"https://codeload.github.com/cardinalby/schema-validator-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225709,"owners_count":21068078,"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","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","schema","schemasafe","validation","validator","yaml"],"created_at":"2024-11-07T00:38:03.379Z","updated_at":"2025-04-10T13:31:59.562Z","avatar_url":"https://github.com/cardinalby.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![test](https://github.com/cardinalby/schema-validator-action/actions/workflows/test.yml/badge.svg)](https://github.com/cardinalby/schema-validator-action/actions/workflows/test.yml)\n[![build](https://github.com/cardinalby/schema-validator-action/actions/workflows/build.yml/badge.svg)](https://github.com/cardinalby/jschema-validator-action/actions/workflows/build.yml)\n\n## Validate JSON or YAML against a schema\n\nA GitHub Action for validating JSON or YAML file against a schema. \nFails if validation doesn't succeed. Uses \n[schemasafe](https://github.com/ExodusMovement/schemasafe) validator under the hood.\n\n## Examples\n\n```yaml\n- name: Validate package.json against a local schema\n  uses: cardinalby/schema-validator-action@v3\n  with:\n    file: 'package.json'\n    schema: 'schemas/package.schema.json'\n```\n\n```yaml\n- name: Validate action.yml against a remote schema\n  uses: cardinalby/schema-validator-action@v3\n  with:\n    file: 'action.yml'\n    schema: 'https://json.schemastore.org/github-action.json'\n```\n\n```yaml\n- name: Validate all json files using their own $schema properties\n  uses: cardinalby/schema-validator-action@v3\n  with:\n    file: 'dir/*.json'\n```\n\n```yaml\n- name: Validate 3 files using the same schema\n  uses: cardinalby/schema-validator-action@v3\n  with:\n    file: 'first.json|second.json|third.json'\n    schema: 'https://json.schemastore.org/swagger-2.0.json'\n```\n\n## Basic inputs\n\n### 🔻 `file` **Required**\nPath to the JSON or YAML file to be validated.\n\n* Can accept a _glob_ pattern (will validate all matched files)\n* Can accept multiple files (or glob patterns) separated by `|` symbol.\n\n### 🔸 `schema`\nPath or URL to JSON or YAML file with a schema to validate against.\n\n**Can be empty** if all validated files contain valid `$schema` property.\nInput value has a priority over `$schema` property in file if both present. \n\n### 🔸 `mode` _default value: \"default\"_\nSets the strictness of the schema compiling. Possible values:\n- `lax`: the most relaxed mode\n- `spec`: mode is the same as 'lax' but also disables format assertion in draft2019-09 and newer $schema versions\n- `default`: used **by default**, doesn't allow unknown keywords and unreachable checks to be present in the schema \n- `strong`: the most strict mode\n\nRead details in [schemasafe documentation](https://github.com/ExodusMovement/schemasafe/blob/master/doc/Options.md).\n\n### 🔸 `fixSchema` _experimental, default value: \"false\"_\nIf `true`, tries to fix schema by stripping non-default \"format\" instructions to make it valid for the\nunderlying library.\n\nThis input is **experimental**, and it's behaviour can be changed in future versions.\n\n## Advanced inputs\n\n### 🔸 `fileParser` _default value: \"auto\"_\nDetermines the way files will be parsed (as JSON or as YAML). Possible values:\n- `auto` (default) - based on file extension (_json/yml/yaml_). It means, _.json_ files containing \nyaml will lead to error. If file extension is unknown, it will behave as `json|yaml` option\n- `json` - parse all files as JSON\n- `yaml` - parse all files as YAML\n- `json|yaml` - try to parse files both with json and yaml parser (compatible with _v2_)\n\n### 🔸 `refSchemasMap`\nContains a JSON object with the schemas needed to resolve external `$ref`s in the main schema. \nJSON object should contain pairs of:\n - key: id of the external schema\n - value: path to schema file or URL to download schema from\n\nExample: `{\"https://my-schemas.com/schema-id\": \"schema_files/my.schema.json\"}`\n\n### 🔸 `refSchemasArray`\nContains a JSON array with the schemas needed to resolve external `$ref`s in the main schema.\nJSON array should contain string elements, each pointing to schema file path or URL to download schema from.\n\nAll schemas should contain `$id` (or `id` for draft-04) property to be identified.\n\nThis input is more convenient alternative for `refSchemasMap` input if all external schemas\ncontain `$id` property.\n\nExample: `[\"schema_files/my.schema.json\"]`\n\n## Outputs\n\n### 🔹 `errorType`\nIs empty if validation succeeds.\n* `file`: file loading or parsing failed\n* `schema`: schema loading, parsing or refs resolving failed\n* `validation`: file data doesn't correspond schema\n\nIn case of multiple files they are processed one by one and `errorType` indicates the first error occurred.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardinalby%2Fschema-validator-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcardinalby%2Fschema-validator-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardinalby%2Fschema-validator-action/lists"}