Skip to content

feat: allow restricting operations for parameter attributes on properties#7899

Open
Maxcastel wants to merge 2 commits intoapi-platform:mainfrom
Maxcastel:feature/allow-restricting-operations-for-parameter-attributes-on-properties
Open

feat: allow restricting operations for parameter attributes on properties#7899
Maxcastel wants to merge 2 commits intoapi-platform:mainfrom
Maxcastel:feature/allow-restricting-operations-for-parameter-attributes-on-properties

Conversation

@Maxcastel
Copy link
Copy Markdown
Contributor

@Maxcastel Maxcastel commented Mar 31, 2026

Q A
Branch? main
Tickets Related to #7870 (closes #6245)
License MIT
Doc PR api-platform/docs#2281

Requires #7870

#[ApiResource(
    operations: [
        new GetCollection(),
        new Get(),
    ],
)]
class Book
{
    // Applies to all operations
    #[QueryParameter(key: 'search', filter: new PartialSearchFilter())]
    private string $title = '';

    // Applies only to GetCollection
    #[QueryParameter(key: 'name', filter: new PartialSearchFilter(), operations: [new GetCollection()])]
    public string $name = '';

    // Applies only to GetCollection (Patch is not in the list of operations) 
    #[HeaderParameter(key: 'X-Authorization', operations: [new GetCollection(), new Patch()])]
    public string $authToken = '';
}

@Maxcastel Maxcastel changed the title feat: allow Parameter attributes on properties feat: allow restricting operations for parameter attributes on properties Mar 31, 2026
@Maxcastel Maxcastel force-pushed the feature/allow-restricting-operations-for-parameter-attributes-on-properties branch from 604e56d to b6ba5e3 Compare March 31, 2026 14:20
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.

feat: allow Parameter attributes on properties

1 participant