Skip to content

Commit eba1d84

Browse files
committed
Fix page limit not being applied when there is no maximum limit
1 parent b8dd43e commit eba1d84

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Endpoint/Index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ private function paginate(ResourceType $resourceType, $query, Context $context):
184184
throw (new BadRequestException('page[limit] must be a positive integer'))->setSourceParameter('page[limit]');
185185
}
186186

187-
$limit = min($schema->getLimit(), $limit);
187+
if ($maxLimit = $schema->getLimit()) {
188+
$limit = min($maxLimit, $limit);
189+
}
188190
}
189191

190192
$offset = 0;

0 commit comments

Comments
 (0)