From 5761627cead3f0181efae885a8c8aacb537e2574 Mon Sep 17 00:00:00 2001 From: Atharva Kale Date: Wed, 15 Jan 2025 18:25:50 +0530 Subject: [PATCH] update openapi schema --- src/flask_ml/flask_ml_server/models.py | 4 +- src/flask_ml/flask_ml_server/openapi.yaml | 74 ++++------------------- 2 files changed, 14 insertions(+), 64 deletions(-) diff --git a/src/flask_ml/flask_ml_server/models.py b/src/flask_ml/flask_ml_server/models.py index 536f936..e2e4d27 100644 --- a/src/flask_ml/flask_ml_server/models.py +++ b/src/flask_ml/flask_ml_server/models.py @@ -1,6 +1,6 @@ # generated by datamodel-codegen: # filename: openapi.yaml -# timestamp: 2024-11-01T23:07:49+00:00 +# timestamp: 2025-01-15T12:55:32+00:00 from __future__ import annotations @@ -27,7 +27,7 @@ class SchemaAPIRoute(BaseModel): task_schema: Annotated[str, Field(examples=['/tasks/{name_of_task}/task_schema'])] run_task: Annotated[str, Field(examples=['/tasks/{name_of_task}'])] payload_schema: Annotated[str, Field(examples=['/tasks/{name_of_task}/payload_schema'])] - sample_payload: Annotated[Optional[str], Field(examples=['/tasks/{name_of_task}/sample_payload'])] = None + sample_payload: Annotated[str, Field(examples=['/tasks/{name_of_task}/sample_payload'])] short_title: Annotated[str, Field(examples=['{A short title for the task}'])] order: Annotated[int, Field(examples=[1])] diff --git a/src/flask_ml/flask_ml_server/openapi.yaml b/src/flask_ml/flask_ml_server/openapi.yaml index 9d272de..294e5bf 100644 --- a/src/flask_ml/flask_ml_server/openapi.yaml +++ b/src/flask_ml/flask_ml_server/openapi.yaml @@ -1,5 +1,4 @@ - -openapi: 3.0.0 +openapi: 3.1.0 info: title: FlaskML version: 1.0.0 @@ -27,63 +26,6 @@ paths: schema: $ref: '#/components/schemas/APIRoutes' - /tasks/generate_db/task_schema: - get: - summary: Get Input Schema for Generating Database - responses: - '200': - description: Input schema for generating database - content: - application/json: - schema: - $ref: '#/components/schemas/TaskSchema' - - /tasks/generate_db: - post: - summary: Run Task to Generate Database - requestBody: - description: Inputs and parameters for generating database - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RequestBody' - responses: - '200': - description: Task completed successfully - content: - application/json: - schema: - $ref: '#/components/schemas/ResponseBody' - - /tasks/face_match/task_schema: - get: - summary: Get Input Schema for Face Matching - responses: - '200': - description: Input schema for face matching - content: - application/json: - schema: - $ref: '#/components/schemas/TaskSchema' - - /tasks/face_match: - post: - summary: Run Task to Perform Face Matching - requestBody: - description: Inputs and parameters for face matching - required: true - content: - application/json: - schema: - $ref: '#/components/schemas/RequestBody' - responses: - '200': - description: Task completed successfully - content: - application/json: - schema: - $ref: '#/components/schemas/ResponseBody' components: schemas: # Info Page models @@ -114,7 +56,7 @@ components: SchemaAPIRoute: type: object - required: [task_schema, run_task, payload_schema, short_title, order] + required: [task_schema, run_task, payload_schema, sample_payload, short_title, order] properties: task_schema: type: string @@ -137,7 +79,7 @@ components: NoSchemaAPIRoute: type: object - required: [run_task, short_title, order] + required: [run_task] properties: run_task: type: string @@ -245,11 +187,12 @@ components: NewFileInputType: type: object - required: [inputType, defaultExtension, allowedExtensions] + required: [defaultExtension, allowedExtensions, inputType] properties: defaultName: type: string example: "my_file" + nullable: true defaultExtension: type: string example: ".db" @@ -342,6 +285,7 @@ components: type: string messageWhenEmpty: type: string + nullable: true default: type: string @@ -446,8 +390,10 @@ components: type: string title: type: string + nullable: true subtitle: type: string + nullable: true DirectoryResponse: type: object @@ -483,8 +429,10 @@ components: type: string title: type: string + nullable: true subtitle: type: string + nullable: true TextResponse: type: object @@ -501,8 +449,10 @@ components: type: string title: type: string + nullable: true subtitle: type: string + nullable: true BatchFileResponse: