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.

Make enum conversion case-insensitive by default

See original GitHub issue

I’d like to propose to make enum value conversion case-insensitive by default, because it’s probably more convenient for the command line user to not care about casing, and the risk to accidentally refer to another enum value that just differs in case is rather low.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ajaltcommented, Jan 24, 2020

That’s a good idea. I decided to add an ignoreCase parameter to enum and choice, with value value defaulting to false for choice, and true for enum.

0reactions
sschuberthcommented, Jan 25, 2020

Even better, thanks a lot!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Case-insensitive matching of a string to a Java enum
To do a case-insensitive matching, one can write a custom method inside the Day enum, e.g. public static Day lookup(String day) { for...
Read more >
Case insensitive enum mapping with @RequestParam
Custom case-insensitive matching. The default behaviour is caused by Spring utilizing com.sun.beans.editors.EnumEditor to map enum values mapped ...
Read more >
Controlling Case Sensitivity in String Comparisons - O'Reilly
The CHAR and VARCHAR types are not case sensitive by default, but may be declared as BINARY to make them case sensitive. ENUM...
Read more >
How To Serialize and Deserialize Enums with Jackson
By default, Jackson will use the Enum name to deserialize from JSON. For example, it'll deserialize the JSON: {"distance":"KILOMETER"}
Read more >
Value Conversions - EF Core - Microsoft Learn
For example, enum to string conversions are used as an example above, ... perform case-insensitive string comparisons by default.
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