mirror of
https://github.com/rancher/norman.git
synced 2025-09-14 06:12:33 +00:00
Add no pagination option
There is now a recognized option for opting out of pagination. Prior, passing a limit of -1 would set the pagination limit to the default, 1000. Now, a value of -1 will set the pagination limit to the max, likely resulting in a non paginated response.
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
var (
|
||||
defaultLimit = int64(1000)
|
||||
maxLimit = int64(3000)
|
||||
maxLimit = int64(10000)
|
||||
)
|
||||
|
||||
func QueryOptions(apiContext *types.APIContext, schema *types.Schema) types.QueryOptions {
|
||||
@@ -67,7 +67,7 @@ func parsePagination(apiContext *types.APIContext) *types.Pagination {
|
||||
return result
|
||||
}
|
||||
|
||||
if limitInt > maxLimit {
|
||||
if limitInt > maxLimit || limitInt == -1 {
|
||||
result.Limit = &maxLimit
|
||||
} else if limitInt >= 0 {
|
||||
result.Limit = &limitInt
|
||||
|
Reference in New Issue
Block a user