Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use go-enum for enums types #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maoueh
Copy link
Contributor

@maoueh maoueh commented Jan 13, 2025

This brings Marshalling/Unmarshalling as well as lsit of enum values, validation and other goodies.

Kept backward compatibility of shortcut names, some where removed because now duplicated with generated names.

This brings Marshalling/Unmarshalling as well as lsit of enum values, validation and other goodies.

Kept backward compatibility of shortcut names, some where removed because now duplicated with generated names.
@maoueh
Copy link
Contributor Author

maoueh commented Jan 13, 2025

Lol oups, just realized the file is actually generated. Seems like it's gonna be hard to offer go-enum support! I initially thought it would have been an easy PR as we uses some of this functionalities currently for validation of arguments (in preparation of replacing firehose internal registry).

@YaroShkvorets Any ideas how we could support go-enum somehow? I checked quicktype quickly, don't think there is anything in there that would help.

I could create a wrapped "generator" where I modify the enums (regex or using Go parser). What do you think?

@YaroShkvorets
Copy link
Member

I'm not a Go expert, so whatever you think works best - I'll merge. Preferably so it can be easily re-generated if the schema changes.

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