glideapps / quicktype

Generate types and converters from JSON, Schema, and GraphQL
https://app.quicktype.io
Apache License 2.0
11.76k stars 1.04k forks source link

feat(go): --enum-type-name-suffix to avoid same-package enum conflicts #2625

Open alpoi-x opened 5 days ago

alpoi-x commented 5 days ago

Description

Adds a --enum-type-name-suffix flag (defaults to false) that will generate Golang enums with their type appended to member names (e.g. Red Colour = "RED" -> RedColour Colour = "RED"), resolving an issue with conflicting enums in the same package.

Related Issue

2624

Motivation and Context

See the issue above for motivation / context, previous behaviour, new behaviour, and test instructions.