diff --git a/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/params.ts b/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/params.ts index f467d4aa58..c1852e5670 100644 --- a/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/params.ts +++ b/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/params.ts @@ -74,6 +74,19 @@ export const offsetParam = { example: 0 }; +export const shuffleParam = { + schema: { + type: 'number', + minimum: 0, + maximum: 1 + }, + in: 'query', + name: 'shuffle', + description: + 'The `shuffle` parameter used for pagination, the response will be shuffled if it is set to 1.', + example: 0 +}; + export const columnNameQueryParam = { schema: { type: 'string' diff --git a/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/paths.ts b/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/paths.ts index 89d60e2b6e..8c533d9725 100644 --- a/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/paths.ts +++ b/packages/nocodb/src/lib/meta/api/swagger/helpers/templates/paths.ts @@ -8,6 +8,7 @@ import { getNestedParams, limitParam, offsetParam, + shuffleParam, referencedRowIdParam, relationTypeParam, rowIdParam, @@ -35,6 +36,7 @@ export const getModelPaths = async (ctx: { sortParam, whereParam, limitParam, + shuffleParam, offsetParam, ...(await getNestedParams(ctx.columns)) ], @@ -198,6 +200,7 @@ export const getModelPaths = async (ctx: { sortParam, whereParam, limitParam, + shuffleParam, offsetParam ], responses: { @@ -375,7 +378,7 @@ export const getModelPaths = async (ctx: { } }, tags: [ctx.tableName], - parameters: [limitParam, offsetParam] + parameters: [limitParam, offsetParam, shuffleParam] } }, [`/api/v1/db/data/${ctx.orgs}/${ctx.projectName}/${ctx.tableName}/{rowId}/{relationType}/{columnName}/{refRowId}`]: { @@ -399,7 +402,7 @@ export const getModelPaths = async (ctx: { } }, tags: [ctx.tableName], - parameters: [limitParam, offsetParam], + parameters: [limitParam, offsetParam, shuffleParam], description: '' }, delete: { @@ -439,7 +442,7 @@ export const getModelPaths = async (ctx: { } }, tags: [ctx.tableName], - parameters: [limitParam, offsetParam] + parameters: [limitParam, offsetParam, shuffleParam] } } }