Skip to content

TypeError: Nelmio\ApiDocBundle\Describer\ApiPlatformDescriber::__construct(): Argument #1 ($documentation) must be of type ApiPlatform\Documentation\DocumentationInterface, ApiPlatform\OpenApi\OpenApi given #5547

Description

@Aerendir

API Platform version(s) affected: ^3.1.6

Description

With ApiPlatform v.3.1.6, in NelmioApiDocBundle we receive this error:

TypeError: Nelmio\ApiDocBundle\Describer\ApiPlatformDescriber::__construct(): Argument #1 ($documentation) must be of type ApiPlatform\Documentation\DocumentationInterface, ApiPlatform\OpenApi\OpenApi given, called in /srv/app/var/cache/test/ContainerU6TwUpp/getNelmioApiDoc_Describers_ApiPlatformService.php on line 24

How to reproduce

Install api-platform/core and try to generate the documentation through NelmioApiDocBundle.

Possible Solution

A possible fix was made in NelmioApiDocBundle, but it seems not be sufficient as the DocumentationInterface is used in many places.

See nelmio/NelmioApiDocBundle#2092

Additional Context

I suppose the sub-tree split done in 3.1.6 broke the code.

Related issues
nelmio/NelmioApiDocBundle#2089

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