Skip to content

Symfony integration for object resource mappers from enm/json-api-common

License

Notifications You must be signed in to change notification settings

eosnewmedia/JSON-API-Object-Resource-Mapper-Bundle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON API Server / Resource Mapper Bundle

Symfony integration for object and resource mappers from enm/json-api-server-common

  1. Installation
  2. Usage

Installation

composer require enm/json-api-server-common

in your AppKernel:

<?php
// config/bundles.php
return [
    // ...
    Enm\Bundle\JsonApi\Mapper\EnmJsonApiMapperBundle::class => ['all'=>true],
    // ...
];

Usage

Your object mappers must be defined as services and tagged with json_api.object_mapper to be detected by this bundle.

Your resource mappers must be defined as services and tagged with json_api.resource_mapper to be detected by this bundle.

services:
    app.mappers.example:
        class: App\Mappers\ExampleMapper # this mapper will implement object and resource mapper interface...
        tags:
            - { name: 'json_api.object_mapper' }
            - { name: 'json_api.resource_mapper' }

The registry service, which you will need for dependency injection, is Enm\JsonApi\Mapper\ObjectResourceMapper.

About

Symfony integration for object resource mappers from enm/json-api-common

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages