Symfony Bundle for map-serialiser component
composer require haskel/map-serializer-bundle
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