IvorySerializerBundle
IvorySerializerBundle copied to clipboard
FOSRestBundle integration does not work
I have tried following the documentation on this, but it does not seem to work.
Seems like there are multiple exceptions here.
[Symfony\Component\DependencyInjection\Exception\InvalidArgumentException]
Unable to replace alias "fos_rest.serializer" with actual definition "ivory.serializer.fos".
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
You have requested a non-existent service "ivory.serializer.fos".
ENV:
- Symfony 3.3.15
- FOSRestBundle 2.3.0
Here's the solution that I have come up with:
# app/config/config.yml
#fos_rest:
# service:
# serializer: ivory.serializer.fos
# app/config/services.yml
services:
fos_rest.serializer:
class: 'Ivory\SerializerBundle\FOS\Serializer'
arguments:
- '@ivory.serializer'
Maybe this could be added to the docs? Thoughts, @egeloen?