- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 311
Can't use symfony serializer when requesting the id "serializer" #583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If it helps: I'm using the version |
http://jmsyst.com/bundles/JMSSerializerBundle/master/configuration#extension-reference jms_serializer:
enable_short_alias: false |
@goetas: Please read the third paragraph of my issue. I already said
The exception is thrown BECAUSE of this setting. |
Yes, I did. If I understood the
means, that if it's null I have an empty array, correct? Which means that it defaults to
to
right? |
Update: If I change that to
it works again (so far). Thanks for your help, just misconfigured it apparently. |
Sorry @goetas , have to interrupt again. When I now call the service
It seems like removing the alias also removes the service? But that can't be, right? |
Which serializer do you need?
|
I want to use both. We use the JMS-Serializer for our API but I know wanted to normalize an object (use the basic serializer functionality), because the JMSSerializer in our version doesn't have the method Isn't it possible to use both at the same time? |
as said:
you have to figure out why the symfony serializer is not available.... regarding the jms serializer:
|
Because I made a mistake. I forgot to enable it in the framework
I replaced all occurences of
This is how it looks now, and this is the error
I'm currently digging to find out where this comes from. |
This looked more like a configuration problem, however. I just resetted my changes and have redone them. Now it works. I will report back if I find anything. |
@goetas Yeah, I think I found the problem and seems like it has to do with the FOSRestBundle, not with this one.
That's the problem. The FOSRestBundle uses the serializer instead of the This documentation sounds like this is how it should be done, and there is no way around that unless I define |
I doubt
Maybe you forgot this:
|
@goetas Yeah, look at tthis post here: #583 (comment) I forgot it. Almost everything works now. The JMS Serializer is doing what it should do, no errors at all, BUT here's the BUT. When I access the serializer via |
Ok, final answer. It seems to work now :D. Don't know what I changed between now and the previous comments, but I'm good to go now, finally> Thanks for your time. |
I want to use the symfony serializer and found this in the services.xml of this bundle
<service id="serializer" alias="jms_serializer.serializer" /><!-- Here for BC, may be disabled in the config -->
I saw, that you can disable it by setting
enable_short_alias: false
which I did in my config.yml, however, now, every service which needs the "serializer" gets this errorUnable to replace alias "fos_elastica.serializer" with actual definition "serializer".
andYou have requested a non-existent service "serializer".
When I debug through my code and am in the
ContainerBuilder::getDefinition
method, inspecting the$this->definitions
is showing me, that there is noserializer
registered. I deleted the cache of course, but nothin ghappened. Any idea what this could be? This is the serializer.xml of the FrameworkBundle of SymfonyThe text was updated successfully, but these errors were encountered: