question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for enum string assignments

See original GitHub issue
enum Color {
  Red  = "RED"
  Teal = "TEAL"
}

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:111
  • Comments:60 (11 by maintainers)

github_iconTop GitHub Comments

14reactions
lanxeoncommented, Mar 19, 2022

Could we also extend this for integer enums as well? For example:

enum Resolution {
  R360 = 360
  R720 = 720
  R1080 = 1080
  R1440 = 1440
}
11reactions
mwitteveencommented, Oct 17, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found