texthtml / json-validator
Validate json data with json-schema
Installs: 4 818
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 2
Open Issues: 2
Requires
- php: ^5.6|^7.0|^8.0
- justinrainbow/json-schema: ^5.0
This package is auto-updated.
Last update: 2024-10-26 15:01:32 UTC
README
$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"]));