2017 © Pedro Peláez
 

library ramltosilex

Silex Provider that generates REST API from a RAML description file

image

damack/ramltosilex

Silex Provider that generates REST API from a RAML description file

  • Thursday, June 22, 2017
  • by damack
  • Repository
  • 1 Watchers
  • 0 Stars
  • 54 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

RamlToSilex

RamlToSilex is a Silex provider to setting up a REST API on top of a relational database, based on a YAML (RAML) configuration file., (*1)

What is RAML ?

RESTful API Modeling Language (RAML) is a simple and sufficient way of describing practically-RESTful APIs. It encourages reuse, enables discovery and pattern-sharing, and aims for merit-based emergence of best practices., (*2)

Installation

To install RamlToSilex library, run the command below and you will get the latest version:, (*3)

composer require damack/ramltosilex

Enable ServiceController, Doctrine and RamlToSilex service providers in your application:, (*4)

$app = new Application();

$app->register(new \Silex\Provider\ServiceControllerServiceProvider());
$app->register(new \Silex\Provider\DoctrineServiceProvider(), array(
    'dbs.options' => array(
        'test' => array(
            'driver' => 'pdo_sqlite',
            'path' => __DIR__ . '/db.sqlite'
        )
    ),
));
$app->register(new Damack\RamlToSilex\RamlToSilexServiceProvider(), array(
    'ramlToSilex.raml_file' => __DIR__ . '/raml/api.raml',
    'ramlToSilex.config_file' => __DIR__ . '/config.json',
    'ramlToSilex.google-app-id' => 'id',
    'ramlToSilex.google-app-secret' => 'secret',
    'ramlToSilex.google-redirect-uri' => 'http://localhost/',
    'ramlToSilex.redirectUri' => 'http://localhost/login.html',
    'ramlToSilex.customController' => function() use ($app) {
        return new CustomController($app);
    }
));

- You need to give the path to the `RAML` file describing your API. You can find an example into the `tests/raml` directory
- You need to give the path to the config file describing your access to the routs and custom controller
- You need to give the app-id, app-secret and redirect-uri so google auth can work

## Function
- Create table from schema definition
- Goolge OAuth authentication
- API authentication with token
- Role based access to routes
- Hidden fields for get
- Custom controller
- API console

### Missing function
- Input validation

## Tests

Run the tests suite with the following commands:

```bash
composer install
composer test

License

is licensed under the MIT License, (*5)

The Versions

22/06 2017

dev-master

9999999-dev

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar damack

22/06 2017

v1.2.6

1.2.6.0

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar damack

22/06 2017

dev-develop

dev-develop

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar damack

07/06 2017

v1.2.5

1.2.5.0

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar damack

07/06 2017

v1.2.4

1.2.4.0

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar damack

26/04 2016

v1.2.3

1.2.3.0

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar damack

25/04 2016

v1.2.2

1.2.2.0

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar damack

16/04 2016

v1.2.1

1.2.1.0

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar damack

12/04 2016

v1.2.0

1.2.0.0

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar damack

11/02 2016

v1.1.0

1.1.0.0

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar damack

04/02 2016

v1.0.0

1.0.0.0

Silex Provider that generates REST API from a RAML description file

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar damack