Skip to content

fix: update field naming to use snake_case in generated proto files - #232

Merged
raphael merged 1 commit into
goadesign:v3from
ilCollez:v3
Dec 21, 2025
Merged

raphael merged 1 commit into
goadesign:v3from
ilCollez:v3

Conversation

@ilCollez

Copy link
Copy Markdown
Contributor

Fix: Use snake_case for proto field names

Problem

The types plugin was generating proto fields in camelCase (firstName, emailAddress) instead of the standard snake_case convention (first_name, email_address).

Solution

Changed types/proto.go line 169 to use codegen.SnakeCase() instead of codegen.Goify().

Testing

  • Added TestProtoFieldNaming with tests for camelCase, acronyms, and multiple word fields
  • All existing tests pass
  • Verified with reproduction case showing correct conversions:
    • firstName => first_name
    • HTTPSEnabled => https_enabled
    • profilePictureURL => profile_picture_url

@raphael

raphael commented Dec 21, 2025

Copy link
Copy Markdown
Member

Thank you!

@raphael
raphael merged commit 2ab84de into goadesign:v3 Dec 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants