From 1bf5f1e3764f420586a7d4bbd83d3fa588953cb2 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Wed, 10 May 2023 11:09:57 +0200 Subject: [PATCH] todo-backend: add additional basic constraints to API schema Signed-off-by: Patrik Oldsberg --- plugins/todo-backend/src/schema/openapi.generated.ts | 3 +++ plugins/todo-backend/src/schema/openapi.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/plugins/todo-backend/src/schema/openapi.generated.ts b/plugins/todo-backend/src/schema/openapi.generated.ts index daf17285b4..0ef39a4054 100644 --- a/plugins/todo-backend/src/schema/openapi.generated.ts +++ b/plugins/todo-backend/src/schema/openapi.generated.ts @@ -149,6 +149,7 @@ export default { required: true, schema: { type: 'string', + minLength: 1, description: 'A reference to the entity to list TODO items for', }, }, @@ -183,6 +184,7 @@ export default { required: false, schema: { type: 'integer', + minimum: 0, description: 'The offset at which to start listing TODO items', }, }, @@ -192,6 +194,7 @@ export default { required: false, schema: { type: 'integer', + minimum: 1, description: 'The number of TODO items to list', }, }, diff --git a/plugins/todo-backend/src/schema/openapi.yaml b/plugins/todo-backend/src/schema/openapi.yaml index 19051c00d3..b16b0bbf2a 100644 --- a/plugins/todo-backend/src/schema/openapi.yaml +++ b/plugins/todo-backend/src/schema/openapi.yaml @@ -96,6 +96,7 @@ paths: required: true schema: type: string + minLength: 1 description: A reference to the entity to list TODO items for - name: orderBy in: query @@ -118,10 +119,12 @@ paths: required: false schema: type: integer + minimum: 0 description: The offset at which to start listing TODO items - name: limit in: query required: false schema: type: integer + minimum: 1 description: The number of TODO items to list