Skip to content

Incorrect deprecation: Since api-platform/core 2.7: Decorating the legacy ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface is deprecated, use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface instead. #5078

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

Closed
bendavies opened this issue Oct 20, 2022 · 4 comments
Labels

Comments

@bendavies
Copy link
Contributor

bendavies commented Oct 20, 2022

API Platform version(s) affected: 2.7.2

Description
Receive the deprecation

Since api-platform/core 2.7: Decorating the legacy ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface is deprecated, use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface instead.

from

if (null === ($options['deprecate'] ?? null)) {

First of all, I am not Decorating the legacy ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface, api-platform is decorating it.

It seems that deprecate => false in options should cascade down from ApiPlatform\Metadata\Property\Factory\LegacyPropertyMetadataFactory, but LegacyPropertyMetadataFactory is not in my chain of metadata factories, as this service is not loaded when metadata_backward_compatibility_layer is enabled.

This is reported by symfony phpunit bridge as a self deprecation handler, i.e. i should be able to resolve it in my own.
This is not true.

How to reproduce
Use on a project using the legacy metadata system

Possible Solution
Unknown

Additional Context
introduced in #4685

@bendavies bendavies changed the title Since api-platform/core 2.7: Decorating the legacy ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface is deprecated, use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface instead. Incorrect deprecation: Since api-platform/core 2.7: Decorating the legacy ApiPlatform\Core\Metadata\Property\Factory\PropertyMetadataFactoryInterface is deprecated, use ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface instead. Oct 20, 2022
@soyuka soyuka added the bug label Oct 21, 2022
@soyuka
Copy link
Member

soyuka commented Oct 21, 2022

thanks for the report this is definitely an issue I'll try to find some time to fix this

@bendavies
Copy link
Contributor Author

thankyou as always @soyuka !

@soyuka
Copy link
Member

soyuka commented Oct 25, 2022

fix will land in next patch

@soyuka soyuka closed this as completed Oct 25, 2022
@bendavies
Copy link
Contributor Author

thankyou!

soyuka added a commit that referenced this issue Nov 4, 2022
* fix: update yaml extractor test file coding standard (#5068)

* fix(graphql): add clearer error message when TwigBundle is disabled but graphQL clients are enabled (#5064)

* fix(metadata): add class key in payload argument resolver (#5067)

* fix: add class key in payload argument resolver

* add null if everything else goes wrong

* fix: upgrade command remove ApiSubresource attribute  (#5049)

Fixes #5038

* fix(doctrine): use abitrary index instead of value (#5079)

* fix: uri template should respect rfc 6570 (#5080)

* fix: remove @internal annotation for Operations (#5089)

See #5084

* fix(metadata): define a name on a single operation (#5090)

fixes #5082

* fix(metadata): deprecate when user decorates in legacy mode (#5091)

fixes #5078

* fix(graphql): use right nested operation (#5102)

* Revert "fix(graphql): use right nested operation (#5102)" (#5111)

This reverts commit 44337dd.

* fix(graphql): always allow to query nested resources (#5112)

* fix(graphql): always allow to query nested resources

* review

Co-authored-by: Alan Poulain <[email protected]>

* chore: php-cs-fixer update

* fix: only alias if exists for opcache preload

Fixes api-platform/api-platform#2284 (#5110)

Co-authored-by: Liviu Mirea <[email protected]>

* chore: php-cs-fixer update (#5118)

* chore: php-cs-fixer update

* chore: php-cs-fixer update

* fix(metadata): upgrade script keep operation name (#5109)

origin: #5105

Co-authored-by: WilliamPeralta <[email protected]>

* chore: v2.7.3 changelog

* chore: v3.0.3 changelog

Co-authored-by: helyakin <[email protected]>
Co-authored-by: ArnoudThibaut <[email protected]>
Co-authored-by: davy-beauzil <[email protected]>
Co-authored-by: Baptiste Leduc <[email protected]>
Co-authored-by: Xavier Laviron <[email protected]>
Co-authored-by: Alan Poulain <[email protected]>
Co-authored-by: Liviu Cristian Mirea-Ghiban <[email protected]>
Co-authored-by: Liviu Mirea <[email protected]>
Co-authored-by: WilliamPeralta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants