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
Discovered in
Manual review of generated output for vendored public specs (PR #90, issue #47).
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):dataSetListdata class dataSetListDataSetListdata class dataSetList_ApisItemDataSetListApisItemperform-searchdata class `Perform-searchRequest`PerformSearchRequestThe hyphenated
`Perform-searchRequest`only compiles because KotlinPoet escapes it with backticks — it is not a valid bare identifier and is awkward to use.Notes
$refusages, nested/inline types,NameRegistrydedup) so links stay intact.@SerialNameon properties and any discriminator/serial-name mapping on polymorphic types must keep the original spec names; only the Kotlin identifier changes.Acceptance criteria
_,-) and PascalCase each segment@SerialName/ discriminator wire names are unchangeddataSetList,perform-search)Discovered in
Manual review of generated output for vendored public specs (PR #90, issue #47).