dmarkham / enumer

A Go tool to auto generate methods for your enums
Other
410 stars 66 forks source link

Feature Request: Different transformation methods for different marshaling types #84

Open masaru-iritani opened 5 months ago

masaru-iritani commented 5 months ago

I propose enhancing enumer to allow specifying different transformation methods for different marshaling types.

Our team currently implements custom GraphQL and JSON marshaling methods based on UPPER_SNAKE_CASE and snake_case representations, respectively. It'd be extremely helpful if enumer can generate both for us while keeping the current representations.

I suppose the feature will accept a transformation method via the value of each marshaling flag as shown below.

-gqlgen=snake-upper -json=snake

If this sounds like a good feature to add, I am ready and willing to contribute to its implementation.