Skip to content

[3.4.3] BC break in Symfony 6.4 - Attempted to call an undefined method named "getSupportedTypes" #6822

@perice

Description

@perice

API Platform version(s) affected: x.y.z
3.4.3 and above

Description
Upgrading from 3.4.2 to 3.4.3 breaks the app because the added ErrorNormalizer wants to call getSupportedTypes() on the inner class which doesn't exist.

Breaks with Symfony 6.4, as the method is not part of the NormalizerInterface:

https://github.com/symfony/symfony/blob/6.4/src/Symfony/Component/Serializer/Normalizer/NormalizerInterface.php

Break caused by adding ErrorNormalizer:

v3.4.2...v3.4.3

How to reproduce
Use Symfony 6.4.*
Use Api Platform 3.4.3+
Not sure - Make it throw an error? or just call getSupportedTypes on something?

Possible Solution
Add getSupportedTypes() to everything that extends the NormalizerInterface
Rewrite the ErrorNormalizer to not call getSupportedTypes() if undefined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions