2017 © Pedro Peláez
 

library json-schema-to-php-generator

Code generation tool for converting JSON schema documents to simple PHP classes.

image

mpmontanez/json-schema-to-php-generator

Code generation tool for converting JSON schema documents to simple PHP classes.

  • Monday, January 30, 2017
  • by mpmontanez
  • Repository
  • 1 Watchers
  • 4 Stars
  • 196 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 5 % Grown

The README.md

JSON Schema to PHP Generator

Objective: build a code generation tool that will convert JSON spec files into simple PHP classes. Java inspiration: https://github.com/joelittlejohn/jsonschema2pojo, (*1)

Demo

Generate sample generated-code by executing the following:, (*2)

php cli/generate.php

The schema source directory will be the 'json-schemas' folder and the code will be placed in the 'generated-code' folder., (*3)

Installation

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

Usage

To generate PHP code from a set of JSON schema files, provide the following paramters to the Generator: the base working directory, the JSON schema source folder name, the generated code destination folder name, and the base namespace to use for the generated PHP classes., (*4)

BEWARE The initial contents of the destination folder will be deleted when calling generate()., (*5)

$generator = new \mpmontanez\JsonSchemaToPhpGenerator\Generator(
    __DIR__ . '/../', 'json-schemas', 'generated-code', 'Sample\\GeneratedCode\\');
$generator->generate();

The Versions

30/01 2017

dev-master

9999999-dev

Code generation tool for converting JSON schema documents to simple PHP classes.

  Sources   Download

The Requires

 

The Development Requires

by Matthew Montanez

30/01 2017

0.0.11

0.0.11.0

Code generation tool for converting JSON schema documents to simple PHP classes.

  Sources   Download

The Requires

 

The Development Requires

by Matthew Montanez

30/01 2017

0.0.1

0.0.1.0

Code generation tool for converting JSON schema documents to simple PHP classes.

  Sources   Download

The Requires

 

The Development Requires

by Matthew Montanez