Add support for enum string assignments
See original GitHub issueenum Color {
Red = "RED"
Teal = "TEAL"
}
Issue Analytics
- State:
- Created 4 years ago
- Reactions:111
- Comments:60 (11 by maintainers)
Top Results From Across the Web
String Enums in C#: Everything You Need to Know
Since C# doesn't support enum with string value, in this blog post, we'll look at alternatives and examples that you can use in...
Read more >TypeScript string enums, and when and how to use them
No matter how much you know about TypeScript enums, this guide covers all the best practices for using string-based enums in production.
Read more >How to define an enum with string value? - Stack Overflow
As far as I know, you will not be allowed to assign string values to enum. What you can do is create a...
Read more >enum — Support for enumerations — Python 3.11.1 ...
EnumType. The type for Enum and its subclasses. · Enum. Base class for creating enumerated constants. · IntEnum. Base class for creating enumerated...
Read more >Handbook - Enums - TypeScript
String enums are a similar concept, but have some subtle runtime differences as documented below. In a string enum, each member has to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Could we also extend this for integer enums as well? For example:
Can this issue be put on higher priority? I am getting a bit tired of having translation methods in each of the external services the API with Prisma is touching. From Python to Typescript to Java all have different default enum values. And none of them have the same behavior as Prisma.
This should be quite easy to solve and at this moment Prisma is forcing a certain naming convention. And that is very unpleasant in the current microservice architecture world.