Closed JarJak closed 4 months ago
Not sure I understand, what's the value of use_symfony_listeners
?
I'm not sure I tried that at https://github.com/soyuka/repro6340 it's probably the same as https://github.com/api-platform/core/issues/6343
closing as I think that this is fixed, lmk if that's not the case.
@soyuka I haven't set specific value of use_symfony_listeners
so I think it defaults to false. Also I don't use a custom controller or custom event listener in my case so I don't think it is related to #6343
After upgrading API Plaftorm core to 3.3.2 and setting use_symfony_listeners: true
I get another error:
Could not resolve argument $data of \"api_platform.action.placeholder::__invoke()\", maybe you forgot to register the controller as a service or missed tagging it with the \"controller.service_arguments\"?
It is 500 error on operation defined as:
new Delete(
openapi: new Operation(
responses: [
204 => new Response(
content: null
),
401 => new Response(
description: 'Unauthorized',
),
],
),
read: false,
processor: DeleteProcessor::class
),
After setting it back to false
this error is gone, but the main issue is still unresolved. For now the only combination of settings which works fine on version 3.3.2 is:
event_listeners_backward_compatibility_layer: true
use_symfony_listeners: false
API Platform version(s) affected: 3.3.0
Description
in version 3.2.x Accept header validation worked correctly with event bc layer set to false. Now it needs to be enabled to work. Without enabling,
\ApiPlatform\Symfony\EventListener\AddFormatListener
isn't even called.How to reproduce Set
event_listeners_backward_compatibility_layer
config variable totrue
Create Api Resource like this one:Call the API to get the resource with
Accept: application/vnd.api+json
header. Result will be:Now, change
event_listeners_backward_compatibility_layer
config variable tofalse
and redo the Api Call.Expected result Still 406 error.
Actual result Regular 200 response.