2017 © Pedro Peláez
 

library nugget

Validate complex JSON objects and process them on change.

image

activerules/nugget

Validate complex JSON objects and process them on change.

  • Tuesday, March 13, 2018
  • by bwinkers
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

nugget

Coverage Status Maintainability Test Coverage, (*1)

A PHP7 library for defining, validating and processing JSON business objects., (*2)

The ActiveRules Nugget Schema treats all data as nuggets. These nuggets can be defined, and related using JSON files. Rules can then be applied to any changes to an object., (*3)

The resulting schema will be moving to dataencyclopedia.com., (*4)

Testing

Local only tests (run by Travis CI)

php vendor/bin/phpunit, (*5)

Using remote schema (broken on Travis CI)

php vendor/bin/phpunit tests/Activerules/Nugget/NuggetTest-Dev.php --testdox, (*6)

Generate Open API schema objects

ActiveRules object definitions are converted to Open API schema objects composed of property definitions., (*7)

Schema from object definitions

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"

Update schema

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/" 

References

JSON References ($ref): https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03, (*8)

JSON Schema: http://json-schema.org/, (*9)

Schemas: http://schema.org/, (*10)

UltriNet, (*11)

The Versions