Reference

std/encoding/naming

std/encoding/src/naming.trb

Naming: how a format spells the field names a type declares. A convention of the format and never of the type, which is why it is an option a format value carries (Json(naming: .SnakeCase)) and nothing on a type mentions it.

type Naming

type Naming

How a format writes a field name. The type declares logLabel; SnakeCase writes and reads log_label.

Examples

print Naming.SnakeCase.applied("logLabel")

case Unchanged

case Unchanged

The name as the type declares it.

case SnakeCase

case SnakeCase

Lower case, with a _ in front of every letter that was upper case: orderId is order_id.

fn applied

fn applied(name: String): String

The name as the format writes it.