Skip to content

Conversation

@ilCollez
Copy link
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
Copy link
Member

raphael commented Dec 21, 2025

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