fix(symfony): validate the classes of the default parameters by Maxcastel · Pull Request #8715 · api-platform/core · GitHub
Skip to content

fix(symfony): validate the classes of the default parameters - #8715

Open
Maxcastel wants to merge 1 commit into
api-platform:5.0from
Maxcastel:fix/default-parameters-config-validation
Open

Maxcastel wants to merge 1 commit into
api-platform:5.0from
Maxcastel:fix/default-parameters-config-validation

Conversation

@Maxcastel

@Maxcastel Maxcastel commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
Q A
Branch? 5.0
Tickets Follow-up of #7758
License MIT

A class typo in defaults.parameters was silently ignored, e.g.

api_platform:
    defaults:
        parameters:
            api_token:
                class: ApiPlatform\Metadata\HeaderParamter
                key: API-Token

The entry was just dropped (and with the class as key, it became a QueryParameter). The configuration now throws when the class doesn't extend Parameter:

The default parameter "api_token" must reference a class extending "ApiPlatform\Metadata\Parameter", "ApiPlatform\Metadata\HeaderParamter" given.

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.

1 participant