https://github.com/opis/json-schema
JSON Schema validator for PHP
https://github.com/opis/json-schema
json-pointer json-schema opis php
Last synced: 11 days ago
JSON representation
JSON Schema validator for PHP
- Host: GitHub
- URL: https://github.com/opis/json-schema
- Owner: opis
- License: apache-2.0
- Created: 2017-12-02T01:02:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-03-05T20:05:44.000Z (about 2 months ago)
- Last Synced: 2025-04-10T00:03:01.955Z (11 days ago)
- Topics: json-pointer, json-schema, opis, php
- Language: PHP
- Homepage: https://opis.io/json-schema
- Size: 597 KB
- Stars: 583
- Watchers: 16
- Forks: 61
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
Opis JSON Schema
====================
[](https://github.com/opis/json-schema/actions)
[](https://packagist.org/packages/opis/json-schema)
[](https://packagist.org/packages/opis/json-schema)
[](https://packagist.org/packages/opis/json-schema)Validate JSON documents
-----------**Opis JSON Schema** is a PHP implementation for the [JSON Schema] standard (draft-2020-12, draft-2019-09, draft-07 and draft-06), that
will help you validate all sorts of JSON documents, whether they are configuration files or a set
of data sent to a RESTful API endpoint.**The library's key features:**
- Supports all keywords from all drafts (draft-2020-12 down to draft-06)
- Support for custom errors inside schema using [`$error` keyword](https://opis.io/json-schema/2.x/errors.html)
- Support for custom PHP filters using [`$filters` keyword](https://docs.opis.io/json-schema/2.x/filters.html)
- Advanced schema reuse using [`$map` keyword](https://docs.opis.io/json-schema/2.x/mappers.html)
- Intuitive schema composition using [slots](https://docs.opis.io/json-schema/2.x/slots.html)
- Support for absolute & relative [json pointers](https://docs.opis.io/json-schema/2.x/pointers.html)
- Support for [URI templates](https://docs.opis.io/json-schema/2.x/uri-template.html)
- Support for [`$data` keyword](https://docs.opis.io/json-schema/2.x/data-keyword.html)
- Support for [casting](https://docs.opis.io/json-schema/2.x/pragma.html#cast)
- Support for custom [formats](https://docs.opis.io/json-schema/2.x/php-format.html) and [media types](https://docs.opis.io/json-schema/2.x/php-media-type.html)### Documentation
The full documentation for this library can be found [here][documentation].
We provide documentation for both [JSON Schema] standard itself as well as for
the library's own API.### License
**Opis JSON Schema** is licensed under the [Apache License, Version 2.0][apache_license].
### Requirements
* PHP ^7.4 || ^8.0
## Installation
**Opis JSON Schema** is available on [Packagist] and it can be installed from a
command line interface by using [Composer].```bash
composer require opis/json-schema
```Or you could directly reference it into your `composer.json` file as a dependency
```json
{
"require": {
"opis/json-schema": "^2.4"
}
}
```[documentation]: https://opis.io/json-schema
[apache_license]: https://www.apache.org/licenses/LICENSE-2.0 "Apache License"
[Packagist]: https://packagist.org/packages/opis/json-schema "Packagist"
[Composer]: https://getcomposer.org "Composer"
[JSON Schema]: http://json-schema.org/ "JSON Schema"