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

Deprecation in QueryParameterValidateListener #6686

Open
dannyvw opened this issue Oct 1, 2024 · 5 comments
Open

Deprecation in QueryParameterValidateListener #6686

dannyvw opened this issue Oct 1, 2024 · 5 comments

Comments

@dannyvw
Copy link
Contributor

dannyvw commented Oct 1, 2024

API Platform version(s) affected: 3.4

Description
User Deprecated: Since api-platform/core 3.3: Use a "ApiPlatform\State\ProviderInterface" as first argument in "ApiPlatform\Symfony\EventListener\QueryParameterValidateListener" instead of "ApiPlatform\ParameterValidator\ParameterValidator".

How to reproduce

Possible Solution

Additional Context

How can we solve this deprecation?

@james2001
Copy link

I wish to know too 😁

@mv-developer
Copy link

+1

@derskythe
Copy link

@dannyvw @james2001 @dannyvw

This helped me: Upgrade Guide

Special guest:

php bin/console api:upgrade-resource

From the topic The Upgrade Command

@soyuka
Copy link
Member

soyuka commented Oct 26, 2024

#6655

@sengaigibon
Copy link

I managed to "solve it" by decorating the event listener QueryParameterValidateListener ...
This is the snippet in my services.yaml file:

services:
    ApiPlatform\Symfony\EventListener\QueryParameterValidateListener:
        decorates: 'api_platform.listener.view.validate_query_parameters'
        arguments:
            $queryParameterValidator: '@App\State\SimpleStateProvider'

App\State\SimpleStateProvider is a dummy class with this content:

class SimpleStateProvider implements ProviderInterface
{

    public function provide(Operation $operation, array $uriVariables = [], array $context = []): object|array|null
    {
        return [];
    }
}

I mean, it's more like a workaround than a solution.

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

6 participants