activerules / nugget
验证复杂的 JSON 对象,并在更改时处理它们。
dev-master
2018-03-13 06:04 UTC
Requires
- php: >=7.0
- activerules/json-guard: ^1.0.4
- activerules/json-reference: ^1.1.1
- asimlqt/php-google-spreadsheet-client: 3.0.*
- aws/aws-sdk-php: ^3.52
- google/apiclient: ^2.0
- nette/forms: ^2.4
- nette/utils: ^2.4
Requires (Dev)
- nette/tester: ^2.0
- php-coveralls/php-coveralls: ^1.0
- phpunit/phpunit: ^6.4
- squizlabs/php_codesniffer: ^3.1.1
- tracy/tracy: ^2.4
This package is not auto-updated.
Last update: 2024-09-20 20:11:01 UTC
README
一个用于定义、验证和处理 JSON 业务对象的 PHP7 库。
ActiveRules Nugget 架构将所有数据视为 nugget
。这些 nugget
可以通过 JSON 文件进行定义和关联。然后可以应用规则来处理对象的所有更改。
结果架构将迁移到 dataencyclopedia.com。
测试
仅本地测试(由 Travis CI 运行)
php vendor/bin/phpunit
使用远程架构(在 Travis CI 上损坏)
php vendor/bin/phpunit tests/Activerules/Nugget/NuggetTest-Dev.php --testdox
生成 Open API 架构对象
ActiveRules 对象定义被转换为由属性定义组成的 Open API 架构对象。
从对象定义中生成架构
php src/bin/schemaFromObject.php -p "./properties" -o "./objects" -s "./t2"
php src/bin/o2s.php -p "./properties" -s "./schema" -o "./objects" -d "./schemadoc"
php src/bin/refsToURLs.php -s "./schema" -u "https://schmema.izzup.com" -o "./objects-izzup"
php src/bin/readPropertiesFromGoogle.php -s "1NeU79bJ-Zic-fwKK2PPuxntNXnbkyMKf6ZTIUHp1n4s" -c ~/.google/izzup-client_secret.json -p "./properties"
更新架构
php src/bin/convertSchemaRefs.php -s "./schema" -r "file://./" -o "./objects-local" -t "#/components/schema/"
php src/bin/convertSchemaRefs.php -s "./schema" -r "https://schema.izzup.com" -o "./objects-izzup" -t "#/components/schema/"
参考
JSON 参考 ($ref): https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03
JSON 架构: https://json-schema.fullstack.org.cn/