[Serializer] Fix argument object denormalization#20690
[Serializer] Fix argument object denormalization#20690dunglas merged 1 commit intosymfony:3.2from ogizanagi:fix/3_2/serializer/fix_arg_object_denormalization
Conversation
|
👍 I had this patch in mind since day one but never found the time to do it thanks very much 🎉 I personally hesitated between:
|
|
Thanks for this fix, looks great for me. For me this feature was the most expected of the 3.2, I hope we can have this one merged within the first release ! |
@tyx : That's already too late for this 😅 http://symfony.com/blog/symfony-3-2-0-released |
|
😢 |
|
IMO it should be merged as a bug fix in the 3.1 branch (and so we'll be in the next minor version of 3.2). |
| $jsonData = '{"bar":{"value":"baz"}}'; | ||
|
|
||
| $serializer = new Serializer( | ||
| array( |
|
👍 |
|
Sorry, you're right, it should be merged in 3.2. |
| try { | ||
| if (null !== $constructorParameter->getClass()) { | ||
| if (!$this->serializer instanceof DenormalizerInterface) { | ||
| throw new LogicException(sprintf('Cannot create an instance of %s from serialized data because the injected serializer is not a denormalizer', $constructorParameter->getClass())); |
There was a problem hiding this comment.
Should we add the FQCN of the serializer here to provide some more context information?
There was a problem hiding this comment.
Similar exceptions above do not add such information (I guess the stacktrace is enough for this)
There was a problem hiding this comment.
Hmm, but other ones are runtime exceptions. Whereas here we need to fix the code/configuration and the stacktrace will only show AbstractNormalizer. So maybe you're right 👍
|
Thanks for fixing this bug @ogizanagi. |
This PR was merged into the 3.2 branch. Discussion ---------- [Serializer] Fix argument object denormalization | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20670 | License | MIT | Doc PR | N/A Fixes #20670. I've seen #19277 (diff) so I think it's the right thing to do, but I didn't follow the thread at the time, so I may have missed something. Ping @theofidry, @dunglas. Commits ------- 27de65a [Serializer] Fix argument object denormalization
Fixes #20670. I've seen #19277 (diff) so I think it's the right thing to do, but I didn't follow the thread at the time, so I may have missed something.
Ping @theofidry, @dunglas.