空手道 0.9.6 到 1.0.1 数组参数升级问题

Karate 0.9.6 to 1.0.1 upgrade issue with array param

在空手道中发送空数组参数时,不会发送该参数。

示例:

Given url homeUrl
And path 'types'
And param filterTypes = []
When method GET
Then status 200
And mach response = '#[0]'

运行调试模式下的空手道我看到以下获取请求

在 0.9.6 版本中

获取 https://{homeUrl}/types?filterTypes=%5B%5D

版本 1.0.1

获取 https://{homeUrl}/types?

只需使用一个字符串。下面这四行可以在 1.1.0 上运行,自己试试看。

* url 'https://httpbin.org/get'
* param foo = '[]'
* method get
* status 200
* match response.url == 'https://httpbin.org/get?foo=[]'

这是日志中的请求:

1 > GET https://httpbin.org/get?foo=%5B%5D
1 > Host: httpbin.org
1 > Connection: Keep-Alive
1 > User-Agent: Apache-HttpClient/4.5.13 (Java/11.0.11)
1 > Accept-Encoding: gzip,deflate