Skip to content

fern-go: error bodies are any for OpenAPI-sourced specs, and group names ignore domain acronyms #17460

Description

@adidavid014

Two smaller findings from the same customer-SDK review. Filing together since both are "the generated output is right but not as good as it could be", and both are unreachable from config today.

1. Error bodies are any for OpenAPI inputs

Fern types error bodies for Fern-definition inputs — seed/go-sdk/errors produces:

type BadRequestError struct {
    *core.APIError
    Body *ErrorBody
}

But an OpenAPI spec whose error response is a named $ref produces:

type BadRequestError struct {
    *core.APIError
    Body any
}

Our overlay attaches an explicit 400 carrying $ref: '#/components/schemas/PlaidError', and PlaidError is a named schema present in the SDK as plaid.PlaidError. Callers still get map[string]any and must string-index error_code / error_type.

Things I ruled out:

  • Not caused by default coexisting with explicit codes — removing the default response via overlay changes nothing.
  • Not a missing-schema problem — PlaidError is generated as a type.
  • I could not find any x-fern-* extension for naming an error schema.

Expected: an OpenAPI error response pointing at a named schema should produce Body *ThatType, matching the Fern-definition behavior.

2. Group names ignore domain acronyms, and there's no override

smart-casing: true handles a fixed initialism list but not domain acronyms, and x-fern-sdk-group-name is taken verbatim. Measured on 1.57.2:

supplied generated
api_key APIKey
url_thing URLThing
oauth Oauth
o_auth OAuth ✅ (workaround)
fdx Fdx
f_d_x FDx
cra_report CraReport

So OAuth is reachable only by misspelling the group as o_auth, and FDX / CRAReport / EWAReport are not reachable at all. We shipped client.OAuth via the workaround and left client.Fdx / client.CraReport as-is.

Expected: either a configurable acronym list (e.g. additionalAcronyms: [FDX, CRA, EWA]) or a per-group casing override. The workaround is obscure enough that a future reader would likely "fix" the spelling and silently regress it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions