From dccf576894c0b22da6a68699e96f034bd12f65e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Cobucci?= Date: Mon, 24 Jun 2019 14:27:28 +0200 Subject: [PATCH] Fix configuration of formatter for HTTP problem details --- config/routing-expressive.xml | 1 - config/serialization-jms.xml | 2 ++ src/Routing/Expressive/RegisterServices.php | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/config/routing-expressive.xml b/config/routing-expressive.xml index 5be849db..5c68c260 100644 --- a/config/routing-expressive.xml +++ b/config/routing-expressive.xml @@ -14,7 +14,6 @@ application/json text/json application/x-json - application/problem+json true diff --git a/config/serialization-jms.xml b/config/serialization-jms.xml index 654a366e..7e507692 100644 --- a/config/serialization-jms.xml +++ b/config/serialization-jms.xml @@ -21,6 +21,7 @@ json + @@ -28,6 +29,7 @@ xml + diff --git a/src/Routing/Expressive/RegisterServices.php b/src/Routing/Expressive/RegisterServices.php index d5986bf2..3f3bfdc6 100644 --- a/src/Routing/Expressive/RegisterServices.php +++ b/src/Routing/Expressive/RegisterServices.php @@ -365,7 +365,8 @@ private function registerApplication( } if ($formatters === []) { - $formatters['application/json'] = new Reference(Json::class); + $formatters['application/json'] = new Reference(Json::class); + $formatters['application/problem+json'] = new Reference(Json::class); } $applicationAllowedFormats = $this->applicationName . '.allowed_formats';