Skip to content

Commit b863905

Browse files
committed
fix: 🐛 output partial query parameter to OpenAPI when pagination_client_enabled is true
1 parent 6bc1121 commit b863905

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/OpenApi/Factory/OpenApiFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,10 @@ private function getPaginationParameters(CollectionOperationInterface|HttpOperat
755755
$parameters[] = new Parameter($this->paginationOptions->getPaginationClientEnabledParameterName(), 'query', 'Enable or disable pagination', false, false, true, ['type' => 'boolean']);
756756
}
757757

758+
if ($operation->getPaginationClientPartial() ?? $this->paginationOptions->isClientPartialPaginationEnabled()) {
759+
$parameters[] = new Parameter($this->paginationOptions->getPartialPaginationParameterName(), 'query', 'Enable or disable partial pagination', false, false, true, ['type' => 'boolean']);
760+
}
761+
758762
return $parameters;
759763
}
760764

src/OpenApi/Tests/Factory/OpenApiFactoryTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ public function testInvoke(): void
182182
'paginatedDummyCollection' => (new GetCollection())->withUriTemplate('/paginated')
183183
->withPaginationClientEnabled(true)
184184
->withPaginationClientItemsPerPage(true)
185+
->withPaginationClientPartial(true)
185186
->withPaginationItemsPerPage(20)
186187
->withPaginationMaximumItemsPerPage(80)
187188
->withOperation($baseOperation),
@@ -994,6 +995,9 @@ public function testInvoke(): void
994995
new Parameter('pagination', 'query', 'Enable or disable pagination', false, false, true, [
995996
'type' => 'boolean',
996997
]),
998+
new Parameter('partial', 'query', 'Enable or disable partial pagination', false, false, true, [
999+
'type' => 'boolean',
1000+
]),
9971001
]
9981002
), $paginatedPath->getGet());
9991003

0 commit comments

Comments
 (0)