Hey there, is it by design, that there are no mini...
# general
t
Hey there, is it by design, that there are no minimum and maximum matchers for numbers (at least in JVM and JS)? Building a regex for those may not always be easy and from what I can think of verifying them should not be less accurate than verifying against a regex.
m
Possibly. Have you checked the feature requests on the GitHub repo? Probably worth looking at the specification repo too as it's really a question for the ecosystem. What's your use case?
t
I'm trying to use our existing DTO classes to generate the consumer's matchers, like proposed by PactGo here, but in Kotlin (so pact jvm). We're using jakarta validation annotations to specify string patterns, array length and ranges of numeric values. I can translate the earlier two to pact matchers, but am not able to do so for min max values of numeric values. Bonus: there are also some strings, that specify a matching pattern, but also specify a
size
in a separate annotation (because it is hard to include in the specific regex). Translating either with Pact: no problem. Translating both: From what I can tell no possible so far.
As a workaround, I can use the Maximum Value as the example value, to prevent the generator from generating a too large one.