From 7e03e77f41710752d3b51bc3000c136f72b82281 Mon Sep 17 00:00:00 2001 From: MickaelSchimpf <122897940+MickaelSchimpf@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:36:31 +0100 Subject: [PATCH 1/5] docs(validation): add missing hook (#1795) docs: add missing hook in validation.md for "Dynamic validation groups" From 85d68975e2f1dc4567f23c3e376248090a5e2ffd Mon Sep 17 00:00:00 2001 From: Nicolas PHILIPPE Date: Wed, 15 Jan 2025 08:26:18 +0100 Subject: [PATCH 2/5] docs(content-negociation): document how to declare an encoder for custom format (#1797) --- core/content-negotiation.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/content-negotiation.md b/core/content-negotiation.md index e52c44b86ca..bbc11eb7549 100644 --- a/core/content-negotiation.md +++ b/core/content-negotiation.md @@ -196,6 +196,19 @@ api_platform: myformat: ['application/vnd.myformat'] ``` +You will also need to declare an encoder which supports the new format: + +```yaml +services: + app.api-platform.myformat.encoder: + class: ApiPlatform\Serializer\JsonEncoder + arguments: + $format: 'myformat' + # The following lines are only needed if autoconfigure is disabled + # tags: + # - { name: 'serializer.encoder' } +``` + API Platform will automatically call the serializer with your defined format name as `format` parameter during the deserialization process (`myformat` in the example). It will then return the result to the client with the requested MIME type using its built-in responder. For non-standard formats, [a vendor, vanity or unregistered MIME type should be used](https://en.wikipedia.org/wiki/Media_type#Vendor_tree). From 607c080f529f68f46dfd0d1012fd48d269039d3a Mon Sep 17 00:00:00 2001 From: Javier Spagnoletti Date: Wed, 12 Feb 2025 05:24:16 -0300 Subject: [PATCH 3/5] fix: multiple formats for custom "api_doc" route example (#2122) --- core/openapi.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/openapi.md b/core/openapi.md index 9371a21cff0..c9e961471dc 100644 --- a/core/openapi.md +++ b/core/openapi.md @@ -512,8 +512,11 @@ Manually register the Swagger UI controller: ```yaml # app/config/routes.yaml api_doc: - path: /api_documentation + path: /api_documentation.{_format} controller: api_platform.swagger_ui.action + methods: ['HEAD', 'GET'] + defaults: + _format: html ``` Change `/api_documentation` to the URI you wish Swagger UI to be accessible on. From 845914d2708435fb9b1d04d53ef8c8bd750936c2 Mon Sep 17 00:00:00 2001 From: Gabriele Martini <2662688+GabrieleMartini@users.noreply.github.com> Date: Wed, 25 Mar 2026 07:39:09 +0100 Subject: [PATCH 4/5] Fix warning syntax in filters documentation (#2269) --- core/filters.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/filters.md b/core/filters.md index 1887fb2ff10..f87f9e2da83 100644 --- a/core/filters.md +++ b/core/filters.md @@ -358,7 +358,7 @@ class SearchFilterParameter ``` ## Doctrine ORM and MongoDB ODM Filters -!> [!WARNING] +> [!WARNING] > Prefer using QueryParameter instead of ApiFilter for more flexibility, this is subject to change in the next major version. ### Basic Knowledge From 21148b8904cc94cc7dc049f3239fe5c80b63f1be Mon Sep 17 00:00:00 2001 From: Gabriele Martini <2662688+GabrieleMartini@users.noreply.github.com> Date: Wed, 25 Mar 2026 07:39:20 +0100 Subject: [PATCH 5/5] Fix image path for Serializer workflow in documentation (#2270) --- core/serialization.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/serialization.md b/core/serialization.md index fb3235fc5e6..37a0ffea3f0 100644 --- a/core/serialization.md +++ b/core/serialization.md @@ -8,7 +8,7 @@ API Platform embraces and extends the Symfony Serializer Component to transform The main serialization process has two stages: -![Serializer workflow](/docs/core/images/SerializerWorkflow.png) +![Serializer workflow](/images/SerializerWorkflow.png) > As you can see in the picture above, an array is used as a man-in-the-middle. This way, Encoders will only deal with turning specific formats into arrays and vice versa. The same way, Normalizers will deal with turning specific objects into arrays and vice versa. -- [The Symfony documentation](https://symfony.com/doc/current/components/serializer.html)