2017 © Pedro Peláez
 

library generator

image

rest-suite/generator

  • Friday, May 26, 2017
  • by theinpu
  • Repository
  • 1 Watchers
  • 0 Stars
  • 557 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 18 Versions
  • 0 % Grown

The README.md

Build Status, (*1)

php-rest (work in progress)

RESTapi server generator based on openapi specs and slim framework, (*2)

Install

Command line: composer require rest-suite/generator
-or-
In composer.json, (*3)

{
  "require-dev": {
    "rest-suite/generator" : "~0"
  }
}

Usage

Generate code

./vendor/bin/apigen generate --namespace 'Example\Api' --output ./examples ./tests/_data/swagger.yml, (*4)

Usage:
  generate [options] [--] [<spec>]
  gen
  g

Arguments:
  spec                        path to swagger specs [default: "swagger.yml"]

Options:
  -o, --output[=OUTPUT]       output path for generated code [default: "./"]
  -ns, --namespace=NAMESPACE  base namespace for generated code
  -m, --models                only generate files for models
  -c, --controllers           only generate files for controllers
  -t, --tests                 only generate files for tests
  -s, --settings              only generate dist settings files
      --override              override existing files  
      --sync                  uses with "--override" option, sync client code between re-generations

Synchronization

TODO: Two-way sync (schema = code) with user-code preservation, (*5)

Examples

Examples of generated code:, (*6)

Documentation

TODO, (*9)

Contribution

Feel free to PR, fork and whatever, (*10)

The Versions