Skip to content

fix(openapi): align glossary entries Accept and rephrase error responses with prod#368

Open
lilkraftwerk wants to merge 2 commits into
mainfrom
spec/glossary-accept-and-rephrase-errors
Open

fix(openapi): align glossary entries Accept and rephrase error responses with prod#368
lilkraftwerk wants to merge 2 commits into
mainfrom
spec/glossary-accept-and-rephrase-errors

Conversation

@lilkraftwerk

Copy link
Copy Markdown
Contributor

What

Two prod-verified spec corrections, surfaced while running the SDK test suites against deepl-mock with OpenAPI request/response validation enabled.

1. GET /v2/glossaries/{glossary_id}/entries — relax the Accept header

The parameter declared a single-value enum: [text/tab-separated-values], so OpenAPI request-validation rejected the ordinary Accept: */* that clients send. Verified against api.deepl.com:

Accept Prod
*/* 200 + TSV
text/tab-separated-values 200 + TSV
application/json 415

Dropping the enum (keeping the default) matches prod's content negotiation; the existing 415 response already covers the unsupported case.

2. POST /v2/write/rephrase — document error responses

Only 200 was declared, so spec-validating tooling treats any error as undocumented. Added the same error set as its sibling /v2/write/correct (400/403/413/415/429/456/500/504). Verified against prod: 400 (invalid params), 403 (invalid key), 415 (unsupported content-type).

Notes

  • openapi.json is regenerated from YAML by the existing workflow.
  • No behavior change to the API; this aligns the documented contract with what production already does.

Lucas Mathis and others added 2 commits June 8, 2026 11:51
…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.
@mintlify

mintlify Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
deepl-c950b784 🟢 Ready View Preview Jun 8, 2026, 9:53 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant