2017 © Pedro Peláez
 

symfony-bundle json-api-server-bundle

Symfony integration of enm/json-api-server

image

enm/json-api-server-bundle

Symfony integration of enm/json-api-server

  • Tuesday, January 23, 2018
  • by eosnewmedia
  • Repository
  • 5 Watchers
  • 2 Stars
  • 1,959 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 16 Versions
  • 11 % Grown

The README.md

JSON API Server-Bundle

Build Status, (*1)

The symfony integration for enm/json-api-server., (*2)

Installation

composer require enm/json-api-server-bundle

Documentation

You should read the docs of enm/json-api-server first, since this bundle only integrate its functionalities into your symfony project., (*3)

  1. Configuration
    1. Bundles
    2. Config
    3. Routing
  2. Request Handler
  3. Error Handling


Configuration

Bundles

<?php
// confing/bundles.php
return [
    // ...
    Enm\Bundle\JsonApi\Server\EnmJsonApiServerBundle::class => ['all' => true],
    // ...
];


Config

All bundle configurations are optional., (*4)

# config/packages/(dev/|prod/|test/|)enm_json_api.yaml
enm_json_api_server:
    debug: false
    url_prefix: '' # configure this to use a url prefix for your json api routes: e.g. /api/{type}. only needed if a prefix is defined in your routing
    route_name_prefix: 'enm.json_api' # Prefix of the route names in symfony (for exception handling). only needed if a nam prefix is defined in your routing

Routing

# app/config/routing.yml | config/routes.yaml
json_api:
  resource: "@EnmJsonApiServerBundle/Resources/config/routing.xml"

If you use the predefined routing (without api prefix configuration), the following routes will be matched:, (*5)

GET /{type}

GET /{type}/{id}

GET /{type}/{id}/relationships/{relationship}

GET /{type}/{id}/{relationship}

POST /{type}

PATCH /{type}/{id}

DELETE /{type}/{id}

POST /{type}/{id}/relationships/{relationship}

PATCH /{type}/{id}/relationships/{relationship}

DELETE /{type}/{id}/relationships/{relationship}

Request Handler

Each request handler can simply be registered via the service container (tag: json_api_server.request_handler):, (*6)

AppBundle\RequestHandler\YourRequestHandler:
    tags:
      - { name: json_api_server.request_handler, type: 'myResources' }

The tag attribute type must contain the json api resource type which will be handled by this request handler., (*7)


Error Handling

The bundle will handle all exceptions and convert them to valid json api error responses., (*8)

The Versions

23/01 2018

dev-master

9999999-dev

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

23/01 2018

2.4.0

2.4.0.0

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

23/01 2018

dev-develop

dev-develop

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

26/07 2017

2.1.2

2.1.2.0

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

26/07 2017

2.1.1

2.1.1.0

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

25/07 2017

2.1.0

2.1.0.0

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

24/07 2017

2.0.2

2.0.2.0

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

20/07 2017

2.0.1

2.0.1.0

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

19/07 2017

2.0.0

2.0.0.0

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

08/06 2017

1.0.1

1.0.1.0

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

08/06 2017

dev-1.x-dev

dev-1.x-dev

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien

08/06 2017

1.0.0

1.0.0.0

Symfony integration of enm/json-api-server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Philipp Marien