https://github.com/texthtml/json-validator
Validate json data with json-schema
https://github.com/texthtml/json-validator
Last synced: 5 months ago
JSON representation
Validate json data with json-schema
- Host: GitHub
- URL: https://github.com/texthtml/json-validator
- Owner: texthtml
- License: agpl-3.0
- Archived: true
- Created: 2016-12-13T15:05:16.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-09-26T14:46:07.000Z (over 1 year ago)
- Last Synced: 2025-10-06T01:42:43.359Z (8 months ago)
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# json-validator
```php
$validator = \TH\JsonValidator\JsonValidator::create();
$data = json_decode($dataJsonString);
$validator->validate($data, (object)["\$ref" => "file://" . __DIR__."/data-schema.json"]));
$decoder = \TH\JsonValidator\JsonDecoder::create();
$data = $decoder->decode($dataJsonString, (object)["\$ref" => "file://" . __DIR__."/data-schema.json"]));
```