Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Aerendir opened this issue Apr 16, 2023 · 5 comments

Comments

@Aerendir
Copy link
Contributor

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

@stale
Copy link

stale bot commented Jun 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 15, 2023
@Aerendir
Copy link
Contributor Author

This issue is not stale.

There is a similar issue on NelmioApiDoc and also a PR to fix it.

No one is replying.

Anyway, this should have been considered a breaking change and not included in a minor release: this is causing a lot of issues and impossibilities to update dependencies.

@stale stale bot removed the stale label Jun 16, 2023
@stale
Copy link

stale bot commented Aug 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 15, 2023
@GuilhemN
Copy link
Contributor

This was fixed in NelmioApiDocBundle.
Although theoretically it's a bc break in API platform I think it's not much for most users and this can be closed.

@stale stale bot removed the stale label Aug 17, 2023
@dunglas
Copy link
Member

dunglas commented Aug 17, 2023

Thanks!!

@dunglas dunglas closed this as completed Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants