From a4c4ffcf3bbcc40d10510f026c4b5a757db8c947 Mon Sep 17 00:00:00 2001 From: Pavel Stejskal Date: Tue, 1 Sep 2020 16:42:55 +0200 Subject: [PATCH] Fix incorrect media types (#1712) --- RouteDescriber/FosRestDescriber.php | 4 ++-- Tests/Functional/FOSRestTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RouteDescriber/FosRestDescriber.php b/RouteDescriber/FosRestDescriber.php index b199df5..70b6a31 100644 --- a/RouteDescriber/FosRestDescriber.php +++ b/RouteDescriber/FosRestDescriber.php @@ -113,11 +113,11 @@ final class FosRestDescriber implements RouteDescriberInterface $requestBody->content = OA\UNDEFINED !== $requestBody->content ? $requestBody->content : []; switch ($type) { case 'json': - $contentType = 'application\json'; + $contentType = 'application/json'; break; case 'xml': - $contentType = 'application\xml'; + $contentType = 'application/xml'; break; default: diff --git a/Tests/Functional/FOSRestTest.php b/Tests/Functional/FOSRestTest.php index 8ddf255..71d28d3 100644 --- a/Tests/Functional/FOSRestTest.php +++ b/Tests/Functional/FOSRestTest.php @@ -29,7 +29,7 @@ class FOSRestTest extends WebTestCase $this->assertHasParameter('foo', 'query', $operation); $this->assertInstanceOf(OA\RequestBody::class, $operation->requestBody); - $bodySchema = $operation->requestBody->content['application\json']->schema; + $bodySchema = $operation->requestBody->content['application/json']->schema; $this->assertHasProperty('bar', $bodySchema); $this->assertHasProperty('baz', $bodySchema);