https://github.com/atoum/json-schema-extension
The atoum json-schema-extension allows you to validate JSON against schemas.
https://github.com/atoum/json-schema-extension
Last synced: 19 days ago
JSON representation
The atoum json-schema-extension allows you to validate JSON against schemas.
- Host: GitHub
- URL: https://github.com/atoum/json-schema-extension
- Owner: atoum
- License: other
- Created: 2014-03-25T10:53:19.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2017-09-25T19:32:24.000Z (over 7 years ago)
- Last Synced: 2025-03-24T16:46:09.101Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 31.3 KB
- Stars: 8
- Watchers: 9
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# atoum/json-schema-extension [](https://travis-ci.org/atoum/json-schema-extension)
This extension validates your JSON strings against a JSON-Schema [specification](http://json-schema.org/).
It also checks if a string a valid JSON string.
## Example
```php
given($string = '{"foo": "bar"}')
->then
->json($string)
;
}public function testValidatesSchema()
{
$this
->given($string = '["foo", "bar"]')
->then
->json($string)->validates('{"title": "test", "type": "array"}')
->json($string)->validates('/path/to/json.schema')
;
}
}
```## Install it
Install extension using [composer](https://getcomposer.org):
```
composer require --dev atoum/json-schema-extension
```Enable the extension using atoum configuration file:
```php
addExtension(new jsonSchema\extension($script));
```## Links
* [atoum](http://atoum.org)
* [atoum's documentation](http://docs.atoum.org)
* [JSON-Schema specification](http://json-schema.org/)## License
json-schema-extension is released under the BSD-3-Clause License. See the bundled [LICENSE](LICENSE) file for details.
