From b0f4bd6ce3d4cba2b5b5cae64ab13197bd3004fc Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Tue, 18 Apr 2023 17:08:47 +0200 Subject: [PATCH 1/3] error schema in api --- server/mergin/sync/public_api.yaml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/mergin/sync/public_api.yaml b/server/mergin/sync/public_api.yaml index 3ffcf0e1..278d6614 100644 --- a/server/mergin/sync/public_api.yaml +++ b/server/mergin/sync/public_api.yaml @@ -593,7 +593,7 @@ paths: "404": $ref: "#/components/responses/NotFoundResp" "422": - $ref: "#/components/responses/UnprocessableEntity" + $ref: "#/components/responses/TrialExpired" x-openapi-router-controller: mergin.sync.public_api_controller #not implemented in connexion, going directly to flask endpoint # /project/push/chunk/{transaction_id}/{chunk_id}: @@ -923,6 +923,15 @@ components: application/json: schema: $ref: '#/components/schemas/ProjectsLimitHit' + TrialExpired: + description: Request was correct and yet server could not process it + content: + application/json: + schema: + $ref: '#/components/schemas/CustomError' + example: + code: TrialExpired + detail: Failed to push changes. Ask the project workspace owner to log in to their Mergin Maps dashboard parameters: namespace: name: namespace From 9d4f89663e1c031f6c0caf7dbb668587352bdf41 Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Tue, 18 Apr 2023 17:12:59 +0200 Subject: [PATCH 2/3] sign CLA --- LICENSES/CLA-signed-list.md | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSES/CLA-signed-list.md b/LICENSES/CLA-signed-list.md index 454d6dd3..1fdad7a2 100644 --- a/LICENSES/CLA-signed-list.md +++ b/LICENSES/CLA-signed-list.md @@ -12,3 +12,4 @@ C/ My company has custom contribution contract with Lutra Consulting Ltd. or I a * PeterPetrik, 31st March 2023 * tomasMizera, 31st March 2023 +* harminius, 18th Aril 2023 From 09115e846cfd4ac22cf96410bf3f33220a4333cc Mon Sep 17 00:00:00 2001 From: Herman Snevajs Date: Thu, 20 Apr 2023 15:24:35 +0200 Subject: [PATCH 3/3] fix schemas --- server/mergin/sync/public_api.yaml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/server/mergin/sync/public_api.yaml b/server/mergin/sync/public_api.yaml index 278d6614..f0c9c9cd 100644 --- a/server/mergin/sync/public_api.yaml +++ b/server/mergin/sync/public_api.yaml @@ -593,7 +593,13 @@ paths: "404": $ref: "#/components/responses/NotFoundResp" "422": - $ref: "#/components/responses/TrialExpired" + description: Request could not be processed by server + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/UnprocessableEntityError" + - $ref: "#/components/schemas/TrialExpired" x-openapi-router-controller: mergin.sync.public_api_controller #not implemented in connexion, going directly to flask endpoint # /project/push/chunk/{transaction_id}/{chunk_id}: @@ -923,15 +929,6 @@ components: application/json: schema: $ref: '#/components/schemas/ProjectsLimitHit' - TrialExpired: - description: Request was correct and yet server could not process it - content: - application/json: - schema: - $ref: '#/components/schemas/CustomError' - example: - code: TrialExpired - detail: Failed to push changes. Ask the project workspace owner to log in to their Mergin Maps dashboard parameters: namespace: name: namespace @@ -950,6 +947,14 @@ components: type: string example: survey schemas: + UnprocessableEntityError: + description: Generic unprocessable request error + TrialExpired: + allOf: + - $ref: '#/components/schemas/CustomError' + example: + code: TrialExpired + detail: Failed to push changes. Ask the project workspace owner to log in to their Mergin Maps dashboard CustomError: type: object properties: