2017 © Pedro Peláez
 

library fakerestserverbundle

Bundles creates Rest API based on schema provided in files. Supports most of the request types and provides routing

image

rpodwika/fakerestserverbundle

Bundles creates Rest API based on schema provided in files. Supports most of the request types and provides routing

  • Friday, March 17, 2017
  • by rpodwika
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Fake Rest Server Bundle

Build Status Coverage Status, (*1)

FakeRestServerBundle is a bundle to create a fully working API based on YAML schema definition., (*2)

How it works?

It parsers a YAML file with the database schema and based on that it creates the endpoints with possibility to perform requests such as GET, POST, PUT, HEAD, DELETE and OPTIONS, (*3)

Schema definition

Given following schema defined in YAML, (*4)

    user:
        - {id: 5, name: "John", surname: "Doe"}
        - {id: 6, name: "Jane", surname: "Doe"}
        - {id: 7, name: "Jack", surname: "Daniels"}

    pictures:
        - {id: 1, name: "A", src: "images/img.jpg"}
        - {id: 2, name: "B", src: "images/213.png"}
        - {id: 3, name: "C", src: "images/12.jpg"}

Following endpoints will be created, (*5)

  ➜  fakeserver php bin/console debug:router
   ------------------------------ --------- -------- ------ ----------------------------------- 
    Name                           Method    Scheme   Host   Path                               
   ------------------------------ --------- -------- ------ ----------------------------------- 
    FAKE_SERVER_GET_user           GET       ANY      ANY    /user/{user}                       
    FAKE_SERVER_POST_user          POST      ANY      ANY    /user                              
    FAKE_SERVER_PUT_user           PUT       ANY      ANY    /user/{user}                       
    FAKE_SERVER_DELETE_user        DELETE    ANY      ANY    /user/{user}                       
    FAKE_SERVER_PATCH_user         PATCH     ANY      ANY    /user/{user}                       
    FAKE_SERVER_HEAD_user          HEAD      ANY      ANY    /user/{user}                       
    FAKE_SERVER_OPTIONS_user       OPTIONS   ANY      ANY    /user/{user}                       
    FAKE_SERVER_GET_pictures       GET       ANY      ANY    /pictures/{pictures}               
    FAKE_SERVER_POST_pictures      POST      ANY      ANY    /pictures                          
    FAKE_SERVER_PUT_pictures       PUT       ANY      ANY    /pictures/{pictures}               
    FAKE_SERVER_DELETE_pictures    DELETE    ANY      ANY    /pictures/{pictures}               
    FAKE_SERVER_PATCH_pictures     PATCH     ANY      ANY    /pictures/{pictures}               
    FAKE_SERVER_HEAD_pictures      HEAD      ANY      ANY    /pictures/{pictures}               
    FAKE_SERVER_OPTIONS_pictures   OPTIONS   ANY      ANY    /pictures/{pictures}  

Plans

  • Adding JSON schema definition
  • Adding PHP array schema definition
  • Creating schema definition which connects definitions in different type
  • Setting FakeServerApiController as a service and adding it to DI
  • Other?

The Versions

17/03 2017

dev-master

9999999-dev

Bundles creates Rest API based on schema provided in files. Supports most of the request types and provides routing

  Sources   Download

GPL

The Requires

 

The Development Requires

17/03 2017

dev-develop

dev-develop

Bundles creates Rest API based on schema provided in files. Supports most of the request types and provides routing

  Sources   Download

GPL

The Requires

 

The Development Requires

16/03 2017

0.1.0

0.1.0.0

Bundles creates Rest API based on schema provided in files. Supports most of the request types and provides routing

  Sources   Download

GPL

The Requires

 

The Development Requires