Skip to content

assertMatchesResourceCollectionJsonSchema and assertMatchesResourceItemJsonSchema breaks after adding ALLOW_EXTRA_ATTRIBUTES to false #3881

Description

@pmontoya

API Platform version(s) affected: 2.5.8

Description
This commit add the serialization context parameter but it breaks serialization groups schema.

I think this due to

$serializerContext ?? $this->getSerializerContext($resourceMetadata, $type, $operationType, $operationName),
: as $serializerContext is not null, $this->getSerializerContext($resourceMetadata, $type, $operationType, $operationName) is not call so serialization groups aren't set in serialization context and assert is false.

How to reproduce
Create an Entity with some properties not serialized and launch test on schema with one of assertMatchesResourceCollectionJsonSchema or assertMatchesResourceItemJsonSchema : the result will be false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions