Speakeasy Logo
Skip to Content

Control property casing: snake, camel

TypeScript SDKs support configurable property naming to match your API’s field naming conventions. Use the modelPropertyCasing configuration to control whether generated TypeScript types use camelCase or snake_case property names.

Configuration

Configure property naming in your gen.yaml file:

<sdk-root>/.speakeasy/gen.yaml
typescript: modelPropertyCasing: "camel" # or "snake"

Options

  • camel (default): Properties use camelCase naming (e.g., firstName, createdAt)
  • snake: Properties use snake_case naming (e.g., first_name, created_at)

Examples

camelCase naming (default)

// Configuration: modelPropertyCasing: "camel" export type User = { id: string; firstName: string; lastName: string; emailAddress: string; createdAt: Date; isActive: boolean; };

snake_case naming

// Configuration: modelPropertyCasing: "snake" export type User = { id: string; first_name: string; last_name: string; email_address: string; created_at: Date; is_active: boolean; };

Last updated on