Skip to main content

Module unique

Module unique 

Source
Expand description

Naming support for generated code.

OpenAPI specs use different naming conventions for their types, operations, and resources. When codegen emits these names, it needs to transform them into identifiers that conform to the grammar and idiomatic case style of each target language.

Codegen segments OpenAPI names into NamePart segments. A UniqueNames scope turns these segment sequences into a representation that’s unique within that scope, and stable regardless of whether it’s rendered AsPascalCase, AsSnakeCase, or AsKebabCase.

Structs§

AsKebabCase
Formats a name as kebab-case.
AsPascalCase
Formats a UniqueName as PascalCase.
AsSnakeCase
Formats a UniqueName as snake_case.
UniqueName
A name that’s unique within a scope, and that can be rendered in any case.
UniqueNames
A scope that claims target language names before final case rendering.

Enums§

NamePart
A segment of an OpenAPI source name.