oaspec/util/naming

Values

pub fn capitalize(input: String) -> String

Capitalize the first letter of a string.

pub fn operation_to_function_name(operation_id: String) -> String

Convert an OpenAPI operation ID to a valid Gleam function name.

pub fn schema_to_type_name(schema_name: String) -> String

Convert an OpenAPI schema name to a valid Gleam type name.

pub fn to_module_name(name: String) -> String

Convert an OpenAPI schema name to a valid Gleam module name.

pub fn to_pascal_case(input: String) -> String

Convert a string to PascalCase for Gleam type names. Examples: “pet_store” -> “PetStore”, “get-user” -> “GetUser”

pub fn to_snake_case(input: String) -> String

Convert a string to snake_case for Gleam function/variable names. Examples: “PetStore” -> “pet_store”, “getUserById” -> “get_user_by_id”

Search Document