Skip to content

Generated type names are not normalized to PascalCase (e.g. dataSetList, Perform-searchRequest) #92

Description

@halotukozak

Description

Generated Kotlin type names are taken verbatim from OpenAPI schema names and inline-derived names, without normalizing to PascalCase. Property names are already camelCased correctly; only type names are affected.

Examples from the vendored USPTO spec (fixtures/public/uspto.yaml):

Schema / origin Generated type Expected
dataSetList data class dataSetList DataSetList
inline array item data class dataSetList_ApisItem DataSetListApisItem
request body of op perform-search data class `Perform-searchRequest` PerformSearchRequest

The hyphenated `Perform-searchRequest` only compiles because KotlinPoet escapes it with backticks — it is not a valid bare identifier and is awkward to use.

Notes

  • Type names must be normalized consistently wherever the type is referenced ($ref usages, nested/inline types, NameRegistry dedup) so links stay intact.
  • Wire-level identity must be preserved: @SerialName on properties and any discriminator/serial-name mapping on polymorphic types must keep the original spec names; only the Kotlin identifier changes.

Acceptance criteria

  • Generated class / enum / interface names are PascalCase and valid bare Kotlin identifiers (no backtick-escaped names)
  • Inline-derived names drop separators (_, -) and PascalCase each segment
  • @SerialName / discriminator wire names are unchanged
  • Covered by tests (USPTO spec is a good fixture: dataSetList, perform-search)

Discovered in

Manual review of generated output for vendored public specs (PR #90, issue #47).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions