Open georgepapas opened 8 years ago
The following matcher definitions should match your array:
"matchingRules": {
"$.body.foo": {"min": 1, "match": "type"},
"$.body.foo[*]": {"match": "regex", "regex": "\\d{2}:\\d{2}"}
}
I'll add a test case to represent this example.
Thanks, Looks reasonable, what would be the correct usage of the dsl to generate this spec?
You'll prob have to raise an issue with the DSL project to generate the correct matchers, but I could imagine something like:
withBody {
foo minLike(1) [
regex('\\d{2}:\\d{2}', '12:00')
]
}
Is it possible to match an array where each array element it _not_ a json object?
i.e.
and then in my matcher
Based on the doco, it seems each array matchers requires the element of the array to be a json object with some structure.