fix(symfony): support repeated global parameter classes - #8451
Open
nozarashi20 wants to merge 3 commits into
Open
fix(symfony): support repeated global parameter classes#8451nozarashi20 wants to merge 3 commits into
nozarashi20 wants to merge 3 commits into
Conversation
Allow named global parameter entries with an explicit class while preserving the legacy class-keyed configuration.
soyuka
requested changes
Sep 1, 2026
| ->children() | ||
| ->scalarNode('class') | ||
| ->cannotBeEmpty() | ||
| ->info('The parameter class for a named global parameter entry.') |
Member
There was a problem hiding this comment.
needs a default to QueryParameter so this doesn't break existing usage.
Author
There was a problem hiding this comment.
What existing usage do you have in mind ? Named entries are new in this PR, and the existing class-keyed syntax still works as before.
Member
There was a problem hiding this comment.
oh right my bad I thought that it'd have failed but after checking Symfony config just ignores it
A named global default parameter entry (a key that is not a Parameter subclass) now builds a QueryParameter when no "class" is given, instead of being silently dropped. The entry name is resolved before config["class"] on purpose: a class-keyed entry must keep its own class. Defaulting the "class" config node instead would inject QueryParameter into every entry and silently rewrite existing HeaderParameter: entries.
RepeatedDefaultParametersTest was the only file in tests/Functional without a namespace, breaking the ApiPlatform\Tests\ PSR-4 rule, and declared its kernel inline instead of tests/Fixtures/app/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes repeated global default parameters in the Symfony integration.
Named entries can now specify their parameter class explicitly, allowing multiple parameters to use the same class while preserving the existing class-keyed configuration syntax.
For example: