2017 © Pedro Peláez
 

library php-json-schema-generator

A JSON Schema Generator written in PHP. The implementation is based on current internet drafts.

image

fezfez/php-json-schema-generator

A JSON Schema Generator written in PHP. The implementation is based on current internet drafts.

  • Tuesday, September 30, 2014
  • by fezfez
  • Repository
  • 1 Watchers
  • 2 Stars
  • 8,758 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 12 Forks
  • 0 Open issues
  • 2 Versions
  • 8 % Grown

The README.md

# PHP JSON Schema Generator

Build Status HHVM Status Code Coverage Scrutinizer Code Quality Project Status, (*1)

Package: php-json-schema-generator, (*2)

PHP JSON Schema Generator, (*3)

About JSON Schema

JSON has become a mainstay in the vast HTTP toolbox. In order to make JSON more stable and to increase the longevity of the data structure there must be some standards put into place. These standards will help to define the structure in a way that the industry can rely on. A uniform way to parse the data and interpret the meaning of the data elements can be found in building a schema that represents it., (*4)

Due to the flexible nature of JSON a solid Schema definition has been slow coming. At this time there is an internet draft being worked on.
(http://tools.ietf.org/html/draft-zyp-json-schema-04), (*5)

The uses/pros/cons and other discussions related to what a schema can and cannot do for you are beyond the scope of this document. Seek your creativity for possible scenarios., (*6)

About This Tool

It is a bit tedious to have to manually write out a JSON Schema every time a new REST point or Data object is created. Because JSON can be used to represent a variety of data objects it can be helpful to have a dynamic way to map from one object to a JSON Schema. A php array is considered an object here for the sake of ease of communication., (*7)

The goal of the tool is to provide an trivial implement for generating a JSON Schema off a wide range of objects. Some objects provide more options for rich schema generation and some do not. JSON itself is very light on metadata so there is a requirement to infer certain meanings based on the structure of the objects., (*8)

Parser Objects Supported

  • JSON string

Installation

Simple, assuming you use composer. Add the below lines to your composer.json and run composer update., (*9)

"require": {
    "solvire/php-json-schema-generator": "dev-master"
}

Testing

PHPUnit should be included with the composer require-dev configuration. The installation will put an executable in the vendor/bin directly so it can be run from there., (*10)

Run:, (*11)

$ vendor/bin/phpunit

The Versions

30/09 2014

dev-master

9999999-dev https://github.com/fezfez/php-json-schema-generator

A JSON Schema Generator written in PHP. The implementation is based on current internet drafts.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Steven Scott

schema parser php json generator

30/09 2014

1.0.0

1.0.0.0 https://github.com/fezfez/php-json-schema-generator

A JSON Schema Generator written in PHP. The implementation is based on current internet drafts.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Steven Scott

schema parser php json generator