Skip to content

v1.5.6: Unable to match mock when body is raw array

Compare
Choose a tag to compare
@steinfletcher steinfletcher released this 06 May 21:26
· 26 commits to master since this release
This is caused by 2 issues:
1. The JSON compare method uses a map[string]interface{}, but it really
   should use interface{} to support arrays
2. The brackets '[]' in the spec trigger the regexp matcher, so it never
   works. The solution is to remove support for regexp on body matching
(it's undocumented) and provided a separate `BodyRegexp` method if
users want to match using regexp. This could potentially break some
existing tests, but the inclusion of this new method should ease the
migration, and I think not supporting matching arrays is a bigger issue
that can't be worked around.