From fb4174d1eb6e98fa80c0c7142f891cca73ff342c Mon Sep 17 00:00:00 2001 From: Junwei Dai Date: Thu, 5 Sep 2024 11:15:50 -0700 Subject: [PATCH] refactor: fix lint spec error Signed-off-by: Junwei Dai --- spec/namespaces/flow_framework.yaml | 77 ++++++++++++------- ...errors.yaml => flow_framework.errors.yaml} | 2 +- 2 files changed, 51 insertions(+), 28 deletions(-) rename spec/schemas/{flow_framework._errors.yaml => flow_framework.errors.yaml} (98%) diff --git a/spec/namespaces/flow_framework.yaml b/spec/namespaces/flow_framework.yaml index d8d8e26ea..282e1feb6 100644 --- a/spec/namespaces/flow_framework.yaml +++ b/spec/namespaces/flow_framework.yaml @@ -23,16 +23,9 @@ paths: '201': $ref: '#/components/responses/flow_framework.create@201' '403': - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/FlowFrameworkAPIDisabledException' + $ref: '#/components/responses/flow_framework.create@403' '400': - description: Bad Request - Multiple possible reasons - oneOf: - - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/BadRequestError' - - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/ConflictError' - - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/MissingParameterError' - - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/ParameterConflictError' - - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/MaxWorkflowsLimitError' - - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/WorkflowSaveError' + $ref: '#/components/responses/flow_framework.create@400' /_plugins/_flow_framework/workflow/{workflow_id}: delete: operationId: flow_framework.delete.0 @@ -48,11 +41,11 @@ paths: '200': $ref: '#/components/responses/flow_framework.delete@200' '400': - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/WorkFlowIdNullError' + $ref: '#/components/responses/flow_framework.delete@400' '403': - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/FlowFrameworkAPIDisabledException' + $ref: '#/components/responses/flow_framework.delete@403' '404': - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/TemplateNotFoundError' + $ref: '#/components/responses/flow_framework.delete@404' put: operationId: flow_framework.update.0 x-operation-group: flow_framework.update @@ -70,7 +63,7 @@ paths: $ref: '#/components/responses/flow_framework.update@201' description: It returns the workflow_id '404': - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/TemplateNotFoundError' + $ref: '#/components/responses/flow_framework.update@404' get: operationId: flow_framework.get.0 x-operation-group: flow_framework.get @@ -82,9 +75,9 @@ paths: - $ref: '#/components/parameters/flow_framework.get::path.workflow_id' responses: '200': - $ref: '#/components/responses/flow_framework.get' + $ref: '#/components/responses/flow_framework.get@200' '404': - $ref: '../schemas/flow_framework._errors.yaml#/components/schemas/TemplateNotFoundError' + $ref: '#/components/responses/flow_framework.get@404' components: parameters: flow_framework.get::path.workflow_id: @@ -209,10 +202,10 @@ components: type: string description: A list of minimum required OpenSearch versions. oneOf: - - required: [name] - - required: [description] - - required: [use_case] - - required: [version] + - required: [ name ] + - required: [ description ] + - required: [ use_case ] + - required: [ version ] responses: flow_framework.create@201: content: @@ -225,6 +218,21 @@ components: description: The ID of the workflow to be updated. Required for the PUT method. required: - workflow_id + flow_framework.create@403: + content: + application/json: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' + flow_framework.create@400: + description: Bad Request - Multiple possible reasons + content: + application/json: + oneOf: + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/BadRequestError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ConflictError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MissingParameterError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/ParameterConflictError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/MaxWorkflowsLimitError' + - $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkflowSaveError' flow_framework.update@201: content: application/json: @@ -254,7 +262,7 @@ components: result: type: string description: The result of the deletion operation. - enum: [deleted, not_found] + enum: [ deleted, not_found ] _shards: type: object properties: @@ -273,7 +281,7 @@ components: _primary_term: type: integer description: The primary term assigned to the document after the deletion. - flow_framework.get: + flow_framework.get@200: content: application/json: schema: @@ -312,12 +320,27 @@ components: last_updated_time: type: integer flow_framework.update@404: + description: Template Not Found Error content: - application/json: { } - flow_framework.create@400: - content: - application/json: { } + application/json: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNotFoundError' flow_framework.delete@400: + description: Work Flow Id Null Error + content: + application/json: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/WorkFlowIdNullError' + flow_framework.delete@403: + description: Flow Framework API Disabled Error + content: + application/json: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/FlowFrameworkAPIDisabledError' + flow_framework.delete@404: + description: Template Not Found Error + content: + application/json: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNotFoundError' + flow_framework.get@404: + description: Template Not Found Error content: - description: Workflow ID can not be null - application/json: { } \ No newline at end of file + application/json: + $ref: '../schemas/flow_framework.errors.yaml#/components/schemas/TemplateNotFoundError' \ No newline at end of file diff --git a/spec/schemas/flow_framework._errors.yaml b/spec/schemas/flow_framework.errors.yaml similarity index 98% rename from spec/schemas/flow_framework._errors.yaml rename to spec/schemas/flow_framework.errors.yaml index 5a17dfa6f..0224b1cba 100644 --- a/spec/schemas/flow_framework._errors.yaml +++ b/spec/schemas/flow_framework.errors.yaml @@ -6,7 +6,7 @@ info: paths: {} components: schemas: - FlowFrameworkAPIDisabledException: + FlowFrameworkAPIDisabledError: content: application/json: type: object