Skip to content

api: use consistent casing for initialisms in API protos #2405

Closed

Description

The Protobuf Style Guide requires TitleCase for message, enum, service, and RPC names, treating abbreviations and acronyms as single words (GetDnsRequest rather than GetDNSRequest).

Currently, our .proto files mix Go-style all-caps initialisms (HTTPRule, HTTPSRule, TLSPassthroughRule, HTTPGetAction, ActorJWTSource, MintActorJWT) with Protobuf TitleCase (HttpRuleEffects).

Because protoc-gen-go always converts lower_snake_case field names to TitleCase (Http, Https, TlsPassthrough, HttpGet, ActorJwt, Uid, Uri) while copying message and RPC names verbatim, using all-caps acronyms in .proto causes:

  1. Casing mismatches within the same generated *pb expression in Go:
&ateapipb.EgressRule{
    Http:           &ateapipb.HTTPRule{...},
    Https:          &ateapipb.HTTPSRule{Effects: &ateapipb.HttpRuleEffects{...}},
    TlsPassthrough: &ateapipb.TLSPassthroughRule{...},
}
&ateapipb.CredentialHeader{ActorJwt: &ateapipb.ActorJWTSource{...}}
&ateompb.WakeupProbe{HttpGet: &ateompb.HTTPGetAction{...}}
  1. Broken word-boundary splitting in non-Go code generators (Python, TypeScript, Rust, Java, etc.) and incompatibility with protoc's enforce_naming_style in Protobuf Editions (if we ever migrate to them).

While this is not ideal because Go's rule for casing of initialisms is different (This is different than Go's rule (https://google.github.io/styleguide/go/decisions.html#initialisms), standardizing .proto definitions on Protobuf TitleCase at least gives a clean boundary. Everything in generated *pb packages uses TitleCase (Http, Https, Tls, Jwt, Uid, Uri), while handwritten Go packages continue to use standard Go initialisms (HTTP, TLS, JWT, UID).

Activity

  1. changed the title [-]Use consistent casing for initialisms in API protos[/-] [+]api: use consistent casing for initialisms in API protos[/+] on Oct 9, 2026
  2. thockin commented on Oct 12, 2026

    @thockin
    Collaborator

    Yeah, I dislike not being Go-style in Go, but any convention is better than none.

    I notice also that, wrt field names we get THREE conventions.

    Proto:

    message MessageName {
        string bar_field_name
    }
    

    Go:

    type MessageName {
        BarFieldName string
    }
    

    JSON:

    { barFieldName: "value" }
    

    I would hope that at least JSON would follow proto names, but it does not.

    Open question: When we write API doc comments, should we xref fields and types in their proto style or Go style or JSON style? e.g.

    // MessageName represents a blah blah blah...
    message MessageName {
        // bar_field_name holds a blah blah blah...
        string bar_field_name
    }
    
  3. juli4n commented on Oct 12, 2026

    @juli4n
    CollaboratorAuthor

    When we write API doc comments, should we xref fields and types in their proto style or Go style or JSON style.

    My thinking was proto style (i.e. bar_field_name). I have a TODO to add this to the style guide, which doesn't talk about documentation at all. WDYT?

  4. thockin commented on Oct 12, 2026

    @thockin
    Collaborator

    SGTM

  5. added a commit that references this issue on Oct 13, 2026
    68895ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area/apiUser-facing API changeskind/cleanupSmall fixes that are not bugs, for example a typo in a code comment

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions