From 87262ec287889696d3c3efe6291633e7b818593c Mon Sep 17 00:00:00 2001 From: Lucas Mathis Date: Mon, 8 Jun 2026 11:51:11 +0200 Subject: [PATCH 1/2] fix(openapi): align glossary entries Accept and rephrase errors with prod Two spec corrections, each verified against api.deepl.com: - GET /v2/glossaries/{glossary_id}/entries: drop the single-value Accept enum (keep the default). Prod accepts */* (200) and returns the entries as TSV; it only rejects an explicit unsupported type with 415. The strict enum made OpenAPI request-validation reject the common */* request, which no real client sends a specific Accept for. - POST /v2/write/rephrase: document the error responses (400/403/413/415/429/456/500/504), matching its sibling /v2/write/correct. Prod returns these (confirmed: 400 invalid params, 403 invalid key, 415 unsupported content-type) but the spec declared only 200. --- api-reference/openapi.yaml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/api-reference/openapi.yaml b/api-reference/openapi.yaml index 8edf293..79be3e3 100644 --- a/api-reference/openapi.yaml +++ b/api-reference/openapi.yaml @@ -1781,8 +1781,6 @@ paths: in: header schema: type: string - enum: - - text/tab-separated-values default: text/tab-separated-values description: The requested format of the returned glossary entries. Currently, supports only `text/tab-separated-values`. @@ -1901,6 +1899,22 @@ paths: description: The improved text. type: string example: This is a sample sentence to improve. + 400: + $ref: '#/components/responses/BadRequest' + 403: + $ref: '#/components/responses/Forbidden' + 413: + $ref: '#/components/responses/PayloadTooLarge' + 415: + description: Unsupported Content-Type. Use `application/json` or `application/x-www-form-urlencoded`. + 429: + $ref: '#/components/responses/TooManyRequests' + 456: + $ref: '#/components/responses/QuotaExceeded' + 500: + $ref: '#/components/responses/InternalServerError' + 504: + $ref: '#/components/responses/ServiceUnavailable' security: - auth_header: [ ] /v2/write/correct: From 47c3335e96caa3add0bc039e704a37a55f1c4652 Mon Sep 17 00:00:00 2001 From: lilkraftwerk <3614128+lilkraftwerk@users.noreply.github.com> Date: Mon, 8 Jun 2026 09:51:38 +0000 Subject: [PATCH 2/2] chore: update OpenAPI JSON files from YAML sources --- api-reference/openapi.json | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/api-reference/openapi.json b/api-reference/openapi.json index 5bf00d1..bdba801 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -2528,9 +2528,6 @@ "in": "header", "schema": { "type": "string", - "enum": [ - "text/tab-separated-values" - ], "default": "text/tab-separated-values" }, "description": "The requested format of the returned glossary entries. Currently, supports only `text/tab-separated-values`.", @@ -2707,6 +2704,30 @@ } } } + }, + "400": { + "$ref": "#/components/responses/BadRequest" + }, + "403": { + "$ref": "#/components/responses/Forbidden" + }, + "413": { + "$ref": "#/components/responses/PayloadTooLarge" + }, + "415": { + "description": "Unsupported Content-Type. Use `application/json` or `application/x-www-form-urlencoded`." + }, + "429": { + "$ref": "#/components/responses/TooManyRequests" + }, + "456": { + "$ref": "#/components/responses/QuotaExceeded" + }, + "500": { + "$ref": "#/components/responses/InternalServerError" + }, + "504": { + "$ref": "#/components/responses/ServiceUnavailable" } }, "security": [