ITV/scala-pact

MinArrayLength rule wrong writing

Closed this issue · 1 comments

There is a problem with writing the ScalaPactMatchingRuleArrayMinLength.

In the specification, the min type rule is defined like this: { "match": "type", "min": 2 }.
But scala-pact generates only {"min": 2 } for the rule and the providers just fail to check the rule correctly.
The problem should be solved with a minor change in this line.

I would try to PR a fix, when I have an opportunity.

Thank you for providing the link, excitingly we also don't have a 'max' (which also means that there is no test for that in the official test suite!). Good find.
A good summary of the bug, I must caution that the Pact-Spec is really flakey and inconsistent. In this case it looks like (as you said) it's just the way we write the spec out, so hopefully you'll be fine.
I was planning to work on Scala-Pact today. I'll start somewhere else but if you'd like me to have a look at this then please drop a message to that effect on here.