-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Messenger - support for JMS serializer #28756
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
https://symfony.com/doc/current/components/serializer.html#handling-arrays
https://symfony.com/doc/current/components/serializer.html#recursive-denormalization-and-type-safety Be sure to use the |
If you want use another serializer, you can implement this interface with JMSSerializer if you want ? |
As @jewome62 mentioned, you can already do it by implementing this interface and set the |
I'd recommend using Symfony Serializer though :) |
@jewome62 You can also use this adapter by @kunicmarko20 : If you are using Hateoas PHP you will have to add some changes to composer to get it working: "jms/serializer": "2.3.0",
"kunicmarko/jms-messenger-adapter": "^0.1.1",
"ocramius/proxy-manager": "2.1.0",
"willdurand/hateoas": "3.0",
"willdurand/hateoas-bundle": "2.0.0" |
I would love to use it. Unfortunately it requires your serialized class to have a getter prefixes with "get" or public properties. Our DTOs have only private properties and getters never have the "get" prefix. :/ |
I have fixed this by configuration using framework:
messenger:
serializer:
- default_serializer: messenger.transport.symfony_serializer
+ default_serializer: messenger.transport.native_php_serializer |
That's great new @spolischook , thank you. I will test the serializer in our next project and give you feedback. |
Uh oh!
There was an error while loading. Please reload this page.
Hi there!
I use a new component messenger but unfortunately, I got still more and more errors about serialization. Symfony serializer has problems with array collections, interfaces and even nested objects.
In my whole project, I use JMS serializer and there are no problems, for this, I need to use Symfony serializer.
How can I fix this or maybe set as a default serializer JMS in messenger component, is it possible?
I'm struggling with normalization, de- and serialization for almost 2 days, IMO Symfony serializer is one of the weakest components, it's almost unusable when sb got used to JMS and its convenience.
The text was updated successfully, but these errors were encountered: