Skip to content

Document namespaced-errors OpenAPI setting - #6870

Merged
devalog merged 3 commits into
mainfrom
devin/1788714403-namespaced-errors-setting
Sep 8, 2026
Merged

Document namespaced-errors OpenAPI setting#6870
devalog merged 3 commits into
mainfrom
devin/1788714403-namespaced-errors-setting

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Summary

settings.namespaced-errors is a new opt-in, per-spec OpenAPI setting in generators.yml (Fern CLI 5.114.0/5.114.1). By default Fern compares shared error responses across the whole API by status code, so when two specs return different bodies for the same status (e.g. two different 429 bodies) the shared error's body collapses to unknown/any in generated SDKs. With the setting enabled, a response object in components.responses tagged x-fern-sdk-namespace: <name> is declared in that namespace and conflict-checked only within it, so customers get typed per-namespace error classes (e.g. plants.TooManyRequestsError) while keeping the spec's endpoints and other types at the root. Only the response-object extension is honored, and the setting applies only to the spec that sets it.

The x-fern-sdk-namespace extension itself (CLI 0.58.0+) was never documented, so this PR also adds a proper extension page rather than describing the extension only in terms of the new setting.

Implements docs for: feat(openapi): add namespaced-errors setting to scope errors by response/body-schema namespace (fern-api/fern#17650) — fern-api/fern#17650 and fix(openapi): scope namespaced-errors to its spec and only honor response-object namespace (fern-api/fern#17655) — fern-api/fern#17655

Pages changed:

  • fern/products/api-def/openapi/extensions/sdk-namespace.mdx (new, /learn/api-definitions/openapi/extensions/sdk-namespaces) — documents x-fern-sdk-namespace on components.schemas (per-schema namespace override, verified against generateIr.ts/AbstractOpenAPIV3ParserContext.ts) and on components.responses (shared errors, gated by namespaced-errors, verified against convertResponse.ts). Registered in api-def.yml next to SDK variables.
  • fern/snippets/openapi-specs.mdx — new settings.namespaced-errors ParamField linking to the extension page (rendered on both the SDKs generators.yml reference and the API definitions generators.yml reference).
  • fern/products/api-def/openapi/extensions/overview.mdx-fern-sdk-namespace row in the extensions table linking to the new page.
  • fern/products/api-def/pages/project-structure.mdx — one-sentence pointer from the "Add namespaces" step.

No global api.settings entry was added: that section only documents auto-generate-idempotency-key and defers per-type settings to the spec-type snippets. pre-commit (Vale) and fern check --warnings pass.

Link to Devin session: https://app.devin.ai/sessions/ee10ef9037304e51a72dec484d7bd7d1
Open in Devin Desktop: https://app.devin.ai/desktop/session/ee10ef9037304e51a72dec484d7bd7d1?variant=devin

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

devalog and others added 2 commits September 8, 2026 12:36
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devalog
devalog merged commit 91526a1 into main Sep 8, 2026
4 checks passed
@devalog
devalog deleted the devin/1788714403-namespaced-errors-setting branch September 8, 2026 18:49
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