{"id":20180567,"url":"https://github.com/ergebnis/json-schema-validator","last_synced_at":"2025-07-29T14:11:56.307Z","repository":{"id":37892998,"uuid":"335242829","full_name":"ergebnis/json-schema-validator","owner":"ergebnis","description":"📃 Provides a composer package with a JSON schema validator, building on top of justinrainbow/json-schema.","archived":false,"fork":false,"pushed_at":"2025-06-23T18:05:28.000Z","size":3191,"stargazers_count":34,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-20T00:10:07.389Z","etag":null,"topics":["json","schema","validator"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/ergebnis.png","metadata":{"funding":{"github":["ergebnis","localheinz"]},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-02T09:58:55.000Z","updated_at":"2025-06-23T18:05:31.000Z","dependencies_parsed_at":"2024-05-17T00:21:25.830Z","dependency_job_id":"9393203a-64a3-4430-b635-fd27c626d88e","html_url":"https://github.com/ergebnis/json-schema-validator","commit_stats":{"total_commits":329,"total_committers":3,"mean_commits":"109.66666666666667","dds":0.3009118541033434,"last_synced_commit":"0ce9316ab88ea43310bb2c189bbdef59ea10bef0"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":"ergebnis/php-package-template","purl":"pkg:github/ergebnis/json-schema-validator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fjson-schema-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fjson-schema-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fjson-schema-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fjson-schema-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ergebnis","download_url":"https://codeload.github.com/ergebnis/json-schema-validator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ergebnis%2Fjson-schema-validator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267701322,"owners_count":24130449,"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-07-29T02:00:12.549Z","response_time":2574,"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","validator"],"created_at":"2024-11-14T02:31:44.091Z","updated_at":"2025-07-29T14:11:56.296Z","avatar_url":"https://github.com/ergebnis.png","language":"PHP","funding_links":["https://github.com/sponsors/ergebnis","https://github.com/sponsors/localheinz"],"categories":[],"sub_categories":[],"readme":"# json-schema-validator\n\n[![Integrate](https://github.com/ergebnis/json-schema-validator/workflows/Integrate/badge.svg)](https://github.com/ergebnis/json-schema-validator/actions)\n[![Merge](https://github.com/ergebnis/json-schema-validator/workflows/Merge/badge.svg)](https://github.com/ergebnis/json-schema-validator/actions)\n[![Release](https://github.com/ergebnis/json-schema-validator/workflows/Release/badge.svg)](https://github.com/ergebnis/json-schema-validator/actions)\n[![Renew](https://github.com/ergebnis/json-schema-validator/workflows/Renew/badge.svg)](https://github.com/ergebnis/json-schema-validator/actions)\n\n[![Code Coverage](https://codecov.io/gh/ergebnis/json-schema-validator/branch/main/graph/badge.svg)](https://codecov.io/gh/ergebnis/json-schema-validator)\n\n[![Latest Stable Version](https://poser.pugx.org/ergebnis/json-schema-validator/v/stable)](https://packagist.org/packages/ergebnis/json-schema-validator)\n[![Total Downloads](https://poser.pugx.org/ergebnis/json-schema-validator/downloads)](https://packagist.org/packages/ergebnis/json-schema-validator)\n[![Monthly Downloads](http://poser.pugx.org/ergebnis/json-schema-validator/d/monthly)](https://packagist.org/packages/ergebnis/json-schema-validator)\n\nThis project provides a [`composer`](https://getcomposer.org) package with a JSON schema validator, building on top of [`justinrainbow/json-schema`](https://github.com/justinrainbow/json-schema).\n\n## Installation\n\nRun\n\n```sh\ncomposer require ergebnis/json-schema-validator\n```\n\n## Usage\n\nIf you have used the validator from `justinrainbow/json-schema` before, you might have observed that it has a few flaws:\n\n- The validator is stateful.\n- The validator requires decoding JSON strings before validating them.\n- The validator returns an `array` of errors, where each error is an `array`.\n\nThis package delegates the validation to `justinrainbow/json-schema` and provides a friendlier interface.\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nuse Ergebnis\\Json\\Json;\nuse Ergebnis\\Json\\Pointer;\nuse Ergebnis\\Json\\SchemaValidator;\n\n$json = Json::fromFile('composer.json');\n$schema = Json::fromString(file_get_contents('https://getcomposer.org/schema.json'));\n$jsonPointer = Pointer\\JsonPointer::document();\n\n$schemaValidator = new SchemaValidator\\SchemaValidator();\n\n$result = $schemaValidator-\u003evalidate(\n    $json,\n    $schema,\n    $jsonPointer\n);\n\nvar_dump($result-\u003eisValid()); // bool\nvar_dump($result-\u003eerrors());  // flat list of `ValidationError` value objects\n```\n\n## Changelog\n\nThe maintainers of this project record notable changes to this project in a [changelog](CHANGELOG.md).\n\n## Contributing\n\nThe maintainers of this project suggest following the [contribution guide](.github/CONTRIBUTING.md).\n\n## Code of Conduct\n\nThe maintainers of this project ask contributors to follow the [code of conduct](https://github.com/ergebnis/.github/blob/main/CODE_OF_CONDUCT.md).\n\n## General Support Policy\n\nThe maintainers of this project provide limited support.\n\nYou can support the maintenance of this project by [sponsoring @ergebnis](https://github.com/sponsors/ergebnis).\n\n## PHP Version Support Policy\n\nThis project supports PHP versions with [active and security support](https://www.php.net/supported-versions.php).\n\nThe maintainers of this project add support for a PHP version following its initial release and drop support for a PHP version when it has reached the end of security support.\n\n## Security Policy\n\nThis project has a [security policy](.github/SECURITY.md).\n\n## License\n\nThis project uses the [MIT license](LICENSE.md).\n\n## Social\n\nFollow [@localheinz](https://twitter.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://twitter.com/intent/follow?screen_name=ergebnis) on Twitter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fergebnis%2Fjson-schema-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fergebnis%2Fjson-schema-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fergebnis%2Fjson-schema-validator/lists"}