Given you use the following configuration:
formats:
jsonld:
mime_types: ['application/ld+json']
html:
mime_types: ['text/html']
# The fact I need to have HTML just to get the documentation is another story...
And you query api platform with the following header:
Content-Type: */*; charset=utf-8
This is the default one in some tools like PhpStorm for example.
Observation
Apiplatform fails with error on "wrong format requested" instead of taking the first format specified in configuration.
Expected behavior
As documented, it should take the first format (here jsonld) as format for the current query.
How to fix
The issue is located inside the class ApiPlatform\Core\EventListener\DeserializeListener.
It's a quick win. It may be tricky finally.
Given you use the following configuration:
And you query api platform with the following header:
Content-Type: */*; charset=utf-8This is the default one in some tools like PhpStorm for example.
Observation
Apiplatform fails with error on "wrong format requested" instead of taking the first format specified in configuration.
Expected behavior
As documented, it should take the first format (here jsonld) as format for the current query.
How to fix
The issue is located inside the class
ApiPlatform\Core\EventListener\DeserializeListener.It's a quick win.It may be tricky finally.