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

Issue with annotation_reader in 2.7 (compatibility_layer: true) #5371

Closed
fabienlem opened this issue Jan 26, 2023 · 6 comments
Closed

Issue with annotation_reader in 2.7 (compatibility_layer: true) #5371

fabienlem opened this issue Jan 26, 2023 · 6 comments

Comments

@fabienlem
Copy link

API Platform version(s) affected: 2.7.7

I encounter a bug that is similar to #5358 in ApiPlatform 2.7 with metadata_backward_compatibility_layer: true.

image

Description

When updating ApiPlatform, the following error is thrown when composer is clearing Symfony's cache.

The service "api_platform.metadata.resource.name_collection_factory.annotation" has a dependency on a non-existent service "annotation_reader".

How to reproduce

Just update to ApiPlatform 2.7.7 with metadata_backward_compatibility_layer: true.

Possible Solution

Adding on-invalid="null" in this file https://github.com/api-platform/core/blob/v2.7.7/src/Symfony/Bundle/Resources/config/legacy/metadata_annotation.xml solve the issue.

Thank you!

@soyuka
Copy link
Member

soyuka commented Jan 26, 2023

Would you be able to patch this? Thanks!

@soyuka
Copy link
Member

soyuka commented Jan 26, 2023

nvm I'll try to patch it as I see more to it then it looks like

@fabienlem
Copy link
Author

Thank you for your quick reply and patch!

@louismariegaborit
Copy link
Contributor

I try the 2.7.8 release but the bug is not fix.

There is a problem in this file :
https://github.com/api-platform/core/blob/2.7/src/Core/Metadata/Property/Factory/AnnotationSubresourceMetadataFactory.php#L86
image

@louismariegaborit
Copy link
Contributor

The PR #5378 resolve the problem with the update of doctrine/annotation 1.13 to 1.14 but we can't update symfony from 6.2.0 to 6.2.5. Clear cache doesn't ended with success. We just have a memory error.

@soyuka
Copy link
Member

soyuka commented Jan 27, 2023

damn I patched it at https://github.com/api-platform/core/blob/2.7/src/Core/Metadata/Property/Factory/AnnotationSubresourceMetadataFactory.php#L59-L61 but forgot the below reader.

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