From 558653e635b14d346fe3e8e83a5898ea4a9fd65c Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 13 Oct 2022 11:48:50 +0530 Subject: [PATCH 1/4] fix(api): remove wrapped property from swagger api response - it's only required for sdk generation Signed-off-by: Pranav C --- .../nocodb/src/lib/meta/api/swagger/helpers/templates/paths.ts | 2 -- 1 file changed, 2 deletions(-) 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 300137b6e5..3760467efb 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 @@ -464,7 +464,6 @@ export const getModelPaths = async (ctx: { description: 'Export all the records from a table.Currently we are only supports `csv` export.', tags: [ctx.tableName], - wrapped: true, responses: { '200': { description: 'OK', @@ -645,7 +644,6 @@ export const getViewPaths = async (ctx: { description: 'Export all the records from a table view. Currently we are only supports `csv` export.', tags: [`${ctx.viewName} ( ${ctx.tableName} grid )`], - wrapped: true, responses: { '200': { description: 'OK', From 4fae00aa3f7552d8e6e5e233449b3e1bbe38ffe5 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 13 Oct 2022 12:04:48 +0530 Subject: [PATCH 2/4] fix(api): swagger count type definition syntax correction Signed-off-by: Pranav C --- .../nocodb/src/lib/meta/api/swagger/helpers/templates/paths.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3760467efb..2b0c4d49ce 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 @@ -561,7 +561,7 @@ export const getViewPaths = async (ctx: { schema: { type: 'object', properties: { - count: 'number', + count: { type: 'number' }, }, }, }, From 985b184eded1ac630f334338dda8d795fb195ef3 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 13 Oct 2022 12:12:16 +0530 Subject: [PATCH 3/4] fix(api): swagger - remove request body from bulk delete by filter Signed-off-by: Pranav C --- .../src/lib/meta/api/swagger/helpers/templates/paths.ts | 7 ------- 1 file changed, 7 deletions(-) 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 2b0c4d49ce..7c68edf73e 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 @@ -349,13 +349,6 @@ export const getModelPaths = async (ctx: { }, }, tags: [ctx.tableName], - requestBody: { - content: { - 'application/json': { - schema: {}, - }, - }, - }, }, }, From 13b518e26b70320d09f5912352c7e50a9a874866 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 13 Oct 2022 12:22:09 +0530 Subject: [PATCH 4/4] fix(api): swagger - provide unique operation ids Signed-off-by: Pranav C --- .../src/lib/meta/api/swagger/helpers/templates/paths.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 7c68edf73e..039690c3a8 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 @@ -28,7 +28,7 @@ export const getModelPaths = async (ctx: { [`/api/v1/db/data/${ctx.orgs}/${ctx.projectName}/${ctx.tableName}`]: { get: { summary: `${ctx.tableName} list`, - operationId: 'db-table-row-list', + operationId: `${ctx.tableName.toLowerCase()}-db-table-row-list`, description: `List of all rows from ${ctx.tableName} ${ctx.type} and response data fields can be filtered based on query params.`, tags: [ctx.tableName], parameters: [ @@ -172,7 +172,7 @@ export const getModelPaths = async (ctx: { { get: { summary: `${ctx.tableName} find-one`, - operationId: 'db-table-row-find-one', + operationId: `${ctx.tableName.toLowerCase()}-db-table-row-find-one`, description: `Find first record matching the conditions.`, tags: [ctx.tableName], parameters: [fieldsParam, whereParam, sortParam],