getdkan/rooted-json-data
最新稳定版本:0.2.3
Composer 安装命令:
composer require getdkan/rooted-json-data
包简介
Access and modify JSON-based data objects while enforcing JSON Schema
README 文档
README
Access and modify JSON-based data objects while enforcing JSON Schema.
This library primarily wires together JsonPath-PHP and Opis JSON Schema, providing a JSON Object class that functions like a small internal service. Data can be added, retrieved and modified through a simple API, and any changes will immediately provoke a re-validation. Validation errors through exceptions with actionable messages.
Example:
$json = '{"number":3}'; $schema = '{"type": "object","properties": {"number":{ "type": "number" }}}'; $data = new RootedJsonData($json, $schema); echo $data->{"$.number"}; // 3 echo $data->{"$[number]"}; // 3 echo "{$data}"; // {"number":3} $data->{"$.number"} = "three"; // EXCEPTION
统计信息
- 总下载量: 148.87k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2020-11-12