From 19f773fae01b43570ce20d02e643d5ef0a51675d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 24 Feb 2023 19:31:27 +0530 Subject: [PATCH] fix: type and schema name corrections Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 2 +- packages/nocodb/src/lib/meta/api/filterApis.ts | 6 +++--- packages/nocodb/src/lib/meta/api/hookFilterApis.ts | 4 ++-- packages/nocodb/src/lib/meta/api/sortApis.ts | 4 ++-- scripts/sdk/swagger.json | 9 ++++++++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 61a4963e0d..504a9fddd2 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -621,7 +621,7 @@ export interface HookReqType { id?: string; fk_model_id?: string; title: string; - description?: string; + description?: string | null; env?: string; event: 'after' | 'before'; operation: 'insert' | 'delete' | 'update'; diff --git a/packages/nocodb/src/lib/meta/api/filterApis.ts b/packages/nocodb/src/lib/meta/api/filterApis.ts index d45f00085a..ff751d47df 100644 --- a/packages/nocodb/src/lib/meta/api/filterApis.ts +++ b/packages/nocodb/src/lib/meta/api/filterApis.ts @@ -136,7 +136,7 @@ router.get( router.post( '/api/v1/db/meta/views/:viewId/filters', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FilterReq'), ncMetaAclMw(filterCreate, 'filterCreate') ); @@ -147,7 +147,7 @@ router.get( router.post( '/api/v1/db/meta/hooks/:hookId/filters', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FilterReq'), ncMetaAclMw(hookFilterCreate, 'filterCreate') ); @@ -159,7 +159,7 @@ router.get( router.patch( '/api/v1/db/meta/filters/:filterId', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FilterReq'), ncMetaAclMw(filterUpdate, 'filterUpdate') ); router.delete( diff --git a/packages/nocodb/src/lib/meta/api/hookFilterApis.ts b/packages/nocodb/src/lib/meta/api/hookFilterApis.ts index 4ba268fbb6..662b7243a2 100644 --- a/packages/nocodb/src/lib/meta/api/hookFilterApis.ts +++ b/packages/nocodb/src/lib/meta/api/hookFilterApis.ts @@ -118,7 +118,7 @@ router.get( router.post( '/hooks/:hookId/filters/', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FilterReq'), ncMetaAclMw(filterCreate, 'filterCreate') ); router.get( @@ -129,7 +129,7 @@ router.get( router.patch( '/hooks/:hookId/filters/:filterId', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/filterReq'), + getAjvValidatorMw('swagger.json#/components/schemas/FilterReq'), ncMetaAclMw(filterUpdate, 'filterUpdate') ); router.delete( diff --git a/packages/nocodb/src/lib/meta/api/sortApis.ts b/packages/nocodb/src/lib/meta/api/sortApis.ts index 8a6508fbc4..233fc4ae13 100644 --- a/packages/nocodb/src/lib/meta/api/sortApis.ts +++ b/packages/nocodb/src/lib/meta/api/sortApis.ts @@ -59,7 +59,7 @@ router.get( router.post( '/api/v1/db/meta/views/:viewId/sorts/', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/sortReq'), + getAjvValidatorMw('swagger.json#/components/schemas/SortReq'), ncMetaAclMw(sortCreate, 'sortCreate') ); router.get( @@ -70,7 +70,7 @@ router.get( router.patch( '/api/v1/db/meta/sorts/:sortId', metaApiMetrics, - getAjvValidatorMw('swagger.json#/components/schemas/sortReq'), + getAjvValidatorMw('swagger.json#/components/schemas/SortReq'), ncMetaAclMw(sortUpdate, 'sortUpdate') ); router.delete( diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index db0673371c..175ee10092 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -9681,7 +9681,14 @@ "type": "string" }, "description": { - "type": "string" + "oneOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] }, "env": { "type": "string"