haskel/map-serializer-bundle

This Bundle integrates library haskel/map-serializer into Symfony

v0.1 2020-10-17 10:23 UTC

This package is auto-updated.

Last update: 2024-10-17 18:59:20 UTC


README

Symfony Bundle for map-serialiser component

Installation

composer require haskel/map-serializer-bundle

Usage

Add bundle to config/bundles.php

Haskel\MapSerializerBundle\MapSerializerBundle::class => ['all' => true]

Add yaml schemas to config/map_serializer Example config/map_serializer/User.yaml :

App\Entity\User:
  default:
    id: 'int'
    username: 'string'
    isActive: 'boolean'
    group: 'default'
    role: 'string'
    name: 'string'
    email: 'string'
    
  simple:
    id: 'int'
    name: 'string'
    
  public:
    username: 'string'
    email: 'string'
    name: 'string'

Well, your response will be processed by \Haskel\MapSerializerBundle\EventListener\ResponseListener