Allow using `new ArrayBuffer(0)` in withRequest.body to be honest in the contract tests
M
Maksym Liannoi (liannoi)
Our Team Lead proposed exciting things when we tried to cover our API endpoint (.NET language) with a contract test, which required binary content in the request body. But, as Matt Fellows mentioned, we cannot interpret
new ArrayBuffer(0)
in something at JSON.So, my question is - can we allow engineers to use
new ArrayBuffer(0)
in withRequest.body, but with interpretation to something like empty JavaScript object ( {} ) or something "magic" actions. In any case, this allowed us to write more honest contract tests, with explicit marks, that we expected to use in the request body - new ArrayBuffer(0)
and can verify that in the generated pact specification.M
Maksym Liannoi (liannoi)
In addition to that feature request, I pin some gist where I have an example of that test case - https://gist.github.com/liannoi/1f778f255252101e5c278abc9bb80bba