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

[Bug] Replace enums by something that can get custom values #1578

Open
Vampire opened this issue Aug 5, 2024 · 2 comments
Open

[Bug] Replace enums by something that can get custom values #1578

Vampire opened this issue Aug 5, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Vampire
Copy link
Collaborator

Vampire commented Aug 5, 2024

Action

The library is very flexible in the usage, so that you can in most places also give some custom value, in case things change since they were enumerated.

But at some places enums are used which can hardly be used with a custom value.

For example the Permission enum has no entry for generating attestations value and there is no convenient way to use it.

Expected

Enum-like values not being enums, but be extensible.

Actual

Enums are not extensible.

Library version

v2.3.0

@Vampire Vampire added the bug Something isn't working label Aug 5, 2024
@krzema12
Copy link
Member

krzema12 commented Aug 5, 2024

Yeah, we should probably have sealed classes with all enum-like values as objects, and a Custom(val value: String) class, like we do for action wrappers. WDYT?

@Vampire
Copy link
Collaborator Author

Vampire commented Aug 5, 2024

Yes, something like that is what I had in mind.
Just was in a rush and did not have the time to pull out an example, being confident you know what I mean. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants