How can I validate integer enum values in Pact JS? #1411
Unanswered
OS-teresamarcelino
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am working with Pact and have an enum that consists of integer values between 0 and 2. I initially tried using regex('0|1|2', "1"), but the generated contract JSON file treats the value as a string type instead of an integer.
Since the enum values are integers, I need a way to validate them as integers within the contract, rather than as strings. What is the recommended approach to properly validate these integer enum values in Pact? Should I use a different matcher for integer validation, or is there a better way to handle this scenario?
Any insights or best practices would be greatly appreciate
Beta Was this translation helpful? Give feedback.
All reactions