Skip to content

OpenAPI OAuth scope enum collides with OAuthScope components #17411

Description

@ngyna

Component

CLI / OpenAPI importer

Priority

P1 — the imported definition can generate uncompilable SDK source.

Bug description

An OpenAPI document that defines both:

  • an OAuth2 security scheme with non-empty scopes, and
  • a component schema named OAuthScope

produces two root types named OauthScope and OAuthScope. The former is synthesized by the importer with a hard-coded name. Their case-only distinction collides in generated file paths, producing invalid TypeScript on a case-insensitive filesystem and case-only paths on a case-sensitive checkout.

Expected: preserve the user-defined OAuthScope and give the synthetic enum a non-colliding name.

Actual: the two declarations converge into corrupt generated source.

A minimal reproducer and regression fix are ready in an accompanying PR.

Versions

  • Fern CLI 5.89.0 reproduces the issue.
  • TypeScript SDK generators 3.85.2 and 3.87.4 both reproduce it.
  • Current fern-api/fern main still hard-codes OauthScope without deconfliction.

Workaround

Adding x-fern-type-name to rename the user component avoids the collision, but unnecessarily changes the user's public SDK model name.

Contributing

Yes.

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