Skip to content

Commit 21f4cf0

Browse files
authored
Fix #3881 revert setting ALLOW_EXTRA_ATTRIBUTES (#4007)
1 parent abd1905 commit 21f4cf0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/Bridge/Symfony/Bundle/Test/ApiTestAssertionsTrait.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use ApiPlatform\Core\JsonSchema\SchemaFactoryInterface;
2121
use PHPUnit\Framework\ExpectationFailedException;
2222
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
23-
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
2423
use Symfony\Contracts\HttpClient\ResponseInterface;
2524

2625
/**
@@ -112,14 +111,14 @@ public static function assertMatchesJsonSchema($jsonSchema, ?int $checkMode = nu
112111

113112
public static function assertMatchesResourceCollectionJsonSchema(string $resourceClass, ?string $operationName = null, string $format = 'jsonld'): void
114113
{
115-
$schema = self::getSchemaFactory()->buildSchema($resourceClass, $format, Schema::TYPE_OUTPUT, OperationType::COLLECTION, $operationName, null, [AbstractNormalizer::ALLOW_EXTRA_ATTRIBUTES => false]);
114+
$schema = self::getSchemaFactory()->buildSchema($resourceClass, $format, Schema::TYPE_OUTPUT, OperationType::COLLECTION, $operationName, null);
116115

117116
static::assertMatchesJsonSchema($schema->getArrayCopy());
118117
}
119118

120119
public static function assertMatchesResourceItemJsonSchema(string $resourceClass, ?string $operationName = null, string $format = 'jsonld'): void
121120
{
122-
$schema = self::getSchemaFactory()->buildSchema($resourceClass, $format, Schema::TYPE_OUTPUT, OperationType::ITEM, $operationName, null, [AbstractNormalizer::ALLOW_EXTRA_ATTRIBUTES => false]);
121+
$schema = self::getSchemaFactory()->buildSchema($resourceClass, $format, Schema::TYPE_OUTPUT, OperationType::ITEM, $operationName, null);
123122

124123
static::assertMatchesJsonSchema($schema->getArrayCopy());
125124
}

0 commit comments

Comments
 (0)