-
-
Notifications
You must be signed in to change notification settings - Fork 844
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2470 from vincentchalamon/issue/api-gateway-norma…
…lizer Decrease ApiGatewayNormalizer priority
- Loading branch information
Showing
5 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
tests/Fixtures/TestBundle/Serializer/Normalizer/OverrideDocumentationNormalizer.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the API Platform project. | ||
* | ||
* (c) Kévin Dunglas <dunglas@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace ApiPlatform\Core\Tests\Fixtures\TestBundle\Serializer\Normalizer; | ||
|
||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface; | ||
|
||
/** | ||
* @author Vincent Chalamon <vincentchalamon@gmail.com> | ||
*/ | ||
final class OverrideDocumentationNormalizer implements NormalizerInterface | ||
{ | ||
private $documentationNormalizer; | ||
|
||
public function __construct(NormalizerInterface $documentationNormalizer) | ||
{ | ||
$this->documentationNormalizer = $documentationNormalizer; | ||
} | ||
|
||
public function normalize($object, $format = null, array $context = []) | ||
{ | ||
$data = $this->documentationNormalizer->normalize($object, $format, $context); | ||
if (isset($data['definitions'])) { | ||
$data['definitions']['RamseyUuidDummy']['properties']['id']['description'] = 'The dummy id'; | ||
} else { | ||
$data['components']['schemas']['RamseyUuidDummy']['properties']['id']['description'] = 'The dummy id'; | ||
} | ||
|
||
return $data; | ||
} | ||
|
||
public function supportsNormalization($data, $format = null) | ||
{ | ||
return $this->documentationNormalizer->supportsNormalization($data, $format); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters