JSON Attributes
JsonPropertyName
Section titled “JsonPropertyName”Overrides the generated JSON property name for a field.
model UserInfo { [JsonPropertyName("user_id")] Id: string;}This attribute is field-local.
JsonPropertyNamingStrategy
Section titled “JsonPropertyNamingStrategy”Applies a naming strategy to generated JSON field names for a model or scope.
#[JsonPropertyNamingStrategy("snake_case")]Supported strategy names are:
PascalCasecamelCasesnake_casekebab-case
JsonPropertyName on a field takes precedence over the naming strategy.