Skip to content

Conversation

@valentindrdt
Copy link
Contributor

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

When adding an operation to an ApiResource, setting paginationViaCursor has no effect because the parent constructor of HttpOperation is missing thepaginationViaCursor parameter.

#[ApiResource(
    // this works
    paginationViaCursor: [ 
        [
            'field' => 'newId',
            'direction' => 'DESC',
        ]
    ],
    operations: [
        new GetCollection(
            uriTemplate: '/users',
            // this does not
            paginationViaCursor: [
                [
                    'field' => 'id',
                    'direction' => 'DESC',
                ]
            ],
        ),
    ],
)]

@vinceAmstoutz
Copy link
Member

Coul you had some tests please?

@soyuka soyuka merged commit dcbc529 into api-platform:4.1 Sep 5, 2025
105 of 111 checks passed
@soyuka
Copy link
Member

soyuka commented Sep 5, 2025

Thanks!

soyuka added a commit that referenced this pull request Sep 5, 2025
Co-authored-by: soyuka <soyuka@users.noreply.github.com>
soyuka added a commit that referenced this pull request Sep 15, 2025
Co-authored-by: soyuka <soyuka@users.noreply.github.com>
Co-authored-by: Matteo Beccati <matteo@beccati.com>
Co-authored-by: valentindrdt <valentin.derudet@les-tilleuls.coop>
Co-authored-by: Emmanuel Averty <emmanuel@les-tilleuls.coop>
Co-authored-by: Flug <flugv1@gmail.com>
fix(symfony): only set name_converter for the default serializer (#6101) (#7365)
fix: pagination via cursor on ApiResource operations (#7368)
fix: phpdoc for HttpOperation paginationViaCursor parameter (#7379)
fix(metadata): compute isWritable during updates (#7383)
fixes #7382
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.

3 participants