You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot use decorated DeserializeListener in v3.2 to accept application/x-www-form-urlencoded form data #1856
After upgrading to v3.2 and switching event_listeners_backward_compatibility_layer to false, the use of decorated DeserializeListener to support application/x-www-form-urlencoded we relied on stopped working.
We followed the current actual guide on https://api-platform.com/docs/core/form-data/ to know if there is a fix, but it seems the guide has not been updated for 3.2.
How to reproduce
Use the following config: config/packages/api_platform.yaml
The expected response: no error.
With event_listeners_backward_compatibility_layer: true it works as expected.
Possible Solution
Have a way to ignore content negotiation mismatch error or a new way to support application/x-www-form-urlencoded with event_listeners_backward_compatibility_layer: false.
Additional Context
Notably the decorated DeserializeListener gets called with event_listeners_backward_compatibility_layer: false (didn't expect that).
Not sure if it is a bug, documentation issue, or both.
use event_listeners_backward_compatibility_layer: true please not that the name is quite misleading event listeners will always be supported. You can decorate our processors in 3.2 if you don't want to use listeners or just keep it like that.
@soyuka, Oh, did not know that. But still, can we fix the documentation at https://api-platform.com/docs/core/form-data/ to note that it is only working with event_listeners_backward_compatibility_layer: true, which will be false by default in 4.0?
The current state of the issue is that there is no documentation on how to do https://api-platform.com/docs/core/form-data/ with processors instead of symfony events, which are not recommended anymore
Reacted by Vincent Amstoutz, Ben and Quentin GAMAIN
Activity
soyuka commentedon Dec 13, 2023
use
event_listeners_backward_compatibility_layer: trueplease not that the name is quite misleading event listeners will always be supported. You can decorate our processors in 3.2 if you don't want to use listeners or just keep it like that.f1amy commentedon Dec 13, 2023
@soyuka, Oh, did not know that. But still, can we fix the documentation at https://api-platform.com/docs/core/form-data/ to note that it is only working with
event_listeners_backward_compatibility_layer: true, which will be false by default in 4.0?soyuka commentedon Dec 13, 2023
Yes definitely, actually we should provide a documentation on how to do this with processors! I'll open an issue there thanks!
mocxi commentedon Nov 7, 2024
Hello,
I'm using version 4.0 and there is no option: event_listeners_backward_compatibility_layer,
when I apply the decorating following the document, it says no such service:
api_platform.listener.request.deserializeI checked the code and saw this: https://github.com/api-platform/symfony/blob/main/Bundle/DependencyInjection/ApiPlatformExtension.php#L198
so if I enable
use_symfony_listenersI can't use provider and processor anymore?vinceAmstoutz commentedon Nov 14, 2024
@mocxi The use of Symfony event listeners to extend API Platform is no longer recommended, as you can see in the documentation
.
Have you tried decorating the
DeserializeProvider?f1amy commentedon Nov 14, 2024
I guess I was tagged by mistake, the above message is addressed to @mocxi
f1amy commentedon Nov 14, 2024
The current state of the issue is that there is no documentation on how to do https://api-platform.com/docs/core/form-data/ with processors instead of symfony events, which are not recommended anymore
Fahl-Design commentedon Apr 9, 2025
a working example how to solve this would indeed be a good thing
+1
fix api-platform#1856
f1amy commentedon Dec 5, 2025
Thanks!