naming

package
v1.51.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package naming provides shared case conversion utilities for oastools packages.

This internal package contains common string transformation functions used by multiple oastools packages including builder and joiner. Functions include ToPascalCase, ToCamelCase, ToSnakeCase, ToKebabCase, and ToTitleCase.

These functions are used for:

  • Builder package: Schema and operation naming from titles
  • Joiner package: Template functions for operation-aware schema renaming

As an internal package, these functions are not part of the public API and may change without notice.

Package naming provides shared string case conversion utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToCamelCase

func ToCamelCase(s string) string

ToCamelCase converts a string to camelCase. Like PascalCase but with the first letter lowercase. Example: "user_profile" -> "userProfile" Example: "UserProfile" -> "userProfile"

func ToKebabCase

func ToKebabCase(s string) string

ToKebabCase converts a string to kebab-case. Like snake_case but with hyphens instead of underscores. Example: "UserProfile" -> "user-profile"

func ToPascalCase

func ToPascalCase(s string) string

ToPascalCase converts a string to PascalCase. Separators (underscore, hyphen, dot, slash) trigger capitalization of the next letter. Example: "user_profile" -> "UserProfile" Example: "api-client" -> "ApiClient"

func ToSnakeCase

func ToSnakeCase(s string) string

ToSnakeCase converts a string to snake_case. Uppercase letters are prefixed with underscore and lowercased. Existing separators (hyphen, dot, slash) are converted to underscores. Example: "UserProfile" -> "user_profile" Example: "APIClient" -> "api_client"

func ToTitleCase

func ToTitleCase(s string) string

ToTitleCase converts the first letter to uppercase. Example: "hello" -> "Hello"

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL