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

fix: allow parameter provider as object #7032

Merged
merged 2 commits into from
Mar 18, 2025

Conversation

deguif
Copy link
Contributor

@deguif deguif commented Mar 18, 2025

Q A
Branch? 3.x
Tickets
License MIT
Doc PR api-platform/docs#...

The type-hint on ApiPlatform\Metadata\Parameter suggest a ParameterProviderInterface can be passed to provider property, but this won't work as expected in this case. This PR ensures it works.

Example:

#[Api\ApiResource(
    operations: [
        new Api\GetCollection(
            parameters: [
                'foo' => new Api\QueryParameter(
                    provider: new FooParameterProvider(),
                ),
            ],
        ),
    ]
)]
class Resource
{
}

@deguif deguif changed the base branch from main to 3.4 March 18, 2025 09:35
@deguif deguif force-pushed the fix-parameter-provider-as-object branch from 72b5b4f to e975c9f Compare March 18, 2025 09:42
@soyuka soyuka force-pushed the fix-parameter-provider-as-object branch from 1c9912e to ea56207 Compare March 18, 2025 10:36
@soyuka soyuka merged commit 7cb5a6d into api-platform:3.4 Mar 18, 2025
76 of 78 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants