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.

Enum validation support?

See original GitHub issue

Is it possible right now? related to #3

example:

enum Foo {
  BAR = 'BAR',
  BAZ = 'BAZ'
}
let e = z.enum(Foo);

e.parse("LOL"); // throws

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

52reactions
agustifcommented, Aug 19, 2021

z.NativeEnum(MyEnum)

Worked for my with a prisma db schema generated enum

38reactions
agustifcommented, Apr 24, 2022

when you find your answer looking for the problem in google and can’t remember how you knew the answer a year back.

Back to the future debugging LOL

Read more comments on GitHub >

github_iconTop Results From Across the Web

Validations for Enum Types - Baeldung
Learn how to build validations for enums using Java custom ... we'll set up a validator, which supports our newly defined annotations.
Read more >
c# - Validate Enum Values - Stack Overflow
To validate if a value is a valid value in an enumeration, you only need to call the static method Enum ...
Read more >
how to handle unknown enum values in swift & java.
Java Enum, @ValidEnum with Constraint that supports JsonIgnoreProperties if not registered. Basically: how to handle unknown enum values in swift & java.
Read more >
How to Validate Enumeration Values in Property Setters
This behavior is unwanted on two levels. First, we don't want the enumeration property to receive a value that is not explicitly defined...
Read more >
Binding and Validating Enums in ASP.NET Core - Ben Foster
The following utility class provides the methods to both validate and parse enums taking into account the EnumMemberAttribute to support ...
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