From f79cef5c1beb2c6b668bb26f72451f0b545730ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20G=C3=B6bel?= Date: Wed, 20 Mar 2024 14:59:05 +0100 Subject: [PATCH] allow to upsert a calculation rule --- openapi.yaml | 26 +++++++++++++------------- paths/calculation-rules-id.yaml | 14 +++++++------- paths/calculation-rules.yaml | 12 ++++++------ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index b015c19..3619144 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -2146,9 +2146,9 @@ paths: summary: Information about calculation rules tags: - Calculation rules - post: - description: Create a new calculation rule. - operationId: postCalculationRule + put: + description: Creates a new or updates an existing calculation rule. + operationId: putCalculationRule requestBody: content: application/json: @@ -2156,18 +2156,18 @@ paths: $ref: '#/components/schemas/CalculationRule' required: true responses: - "201": + "200": content: application/json: schema: $ref: '#/components/schemas/CalculationRule' - description: Successfully created a new calculation rule - summary: Create an calculation rule + description: Successfully created or updated a calculation rule + summary: Creates or updates a calculation rule tags: - Calculation rules /calculation-rules/{calculation-rule-id}: delete: - description: Deletes an calculation rule. + description: Deletes a calculation rule. operationId: deleteCalculationRuleById parameters: - description: The id of the calculation rule @@ -2182,11 +2182,11 @@ paths: description: Successfully deleted the calculation rule "404": description: Calculation rule with id not found - summary: Delete an calculation rule + summary: Delete a calculation rule tags: - Calculation rules get: - description: Gets information about an calculation rule. + description: Gets information about a calculation rule. operationId: getCalculationRuleById parameters: - description: The id of the calculation rule @@ -2202,14 +2202,14 @@ paths: application/json: schema: $ref: '#/components/schemas/CalculationRule' - description: Successfully returned an calculation rule + description: Successfully returned ancalculation rule "404": description: Calculation rule with id not found - summary: Information about an calculation rules rule + summary: Information about a calculation rules rule tags: - Calculation rules put: - description: Update an calculation rule. + description: Update a calculation rule. operationId: putCalculationRuleById parameters: - description: The id of the calculation rule @@ -2234,7 +2234,7 @@ paths: description: Successfully updated an existing calculation rule "404": description: Calculation rule with id not found - summary: Update an calculation rule + summary: Update a calculation rule tags: - Calculation rules /alarms: diff --git a/paths/calculation-rules-id.yaml b/paths/calculation-rules-id.yaml index 6ac9a73..3fee51a 100644 --- a/paths/calculation-rules-id.yaml +++ b/paths/calculation-rules-id.yaml @@ -1,14 +1,14 @@ get: tags: - Calculation rules - summary: Information about an calculation rules rule - description: Gets information about an calculation rule. + summary: Information about a calculation rules rule + description: Gets information about a calculation rule. operationId: getCalculationRuleById parameters: - $ref: '../parameters/calculation-rule-id.yaml' responses: 200: - description: Successfully returned an calculation rule + description: Successfully returned ancalculation rule content: application/json: schema: @@ -19,8 +19,8 @@ get: delete: tags: - Calculation rules - summary: Delete an calculation rule - description: Deletes an calculation rule. + summary: Delete a calculation rule + description: Deletes a calculation rule. operationId: deleteCalculationRuleById parameters: - $ref: '../parameters/calculation-rule-id.yaml' @@ -33,8 +33,8 @@ delete: put: tags: - Calculation rules - summary: Update an calculation rule - description: Update an calculation rule. + summary: Update a calculation rule + description: Update a calculation rule. operationId: putCalculationRuleById parameters: - $ref: '../parameters/calculation-rule-id.yaml' diff --git a/paths/calculation-rules.yaml b/paths/calculation-rules.yaml index 6b7d158..3b5d241 100644 --- a/paths/calculation-rules.yaml +++ b/paths/calculation-rules.yaml @@ -16,12 +16,12 @@ get: items: $ref: '../schemas/CalculationRule.yaml' -post: +put: tags: - Calculation rules - summary: Create an calculation rule - description: Create a new calculation rule. - operationId: postCalculationRule + summary: Creates or updates a calculation rule + description: Creates a new or updates an existing calculation rule. + operationId: putCalculationRule requestBody: required: true content: @@ -29,8 +29,8 @@ post: schema: $ref: '../schemas/CalculationRule.yaml' responses: - 201: - description: Successfully created a new calculation rule + 200: + description: Successfully created or updated a calculation rule content: application/json: schema: