heetch / heetch/avro

Generated struct field names should be PascalCase without underscores

Open
#147 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
95
Forks
18
PR merge metrics
No merged PRs in 30d

Description

The avrogo code generator produces non-idiomatic Go struct field names when Avro schema fields contain underscores. It preserves underscores in field names (e.g., Event_type) instead of converting to proper PascalCase (e.g., EventType).

{
"type": "record",
"name": "TestEvent",
"namespace": "test.events",
"fields": [
{
"name": "event_type",
"type": "string"
},
{
"name": "user_id",
"type": "string"
}
]
}

generates

type TestEvent struct {
Event_type string `json:"event_type"`
User_id string `json:"user_id"`
}

not
type TestEvent struct {
EventType string `json:"event_type"`
UserId string `json:"user_id"`
}

### save the exampel schema to disk and run ###

avrogo -p test test_event.avsc

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.