Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@fabienlem

Description

@fabienlem

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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