我有以下模式的 URL (GET REQUEST)
- ^/testpath/1/test?pathid=1
- ^/testpath/1/test?pathid=1,2
- ^/testpath/1/test?pathid=1,2,5
其中 pathid 查询字符串参数以逗号分隔
我有以下粗短的映射来匹配这些 url 模式
- request:
url: ^/testpath/(.*)/test
query:
pathid: '1'
method: GET
response:
headers:
Content-Type: application/json
status: 200
file: response/path-1.json
- request:
url: ^/testpath/(.*)/test
query:
pathid: '1,2'
method: GET
response:
headers:
Content-Type: application/json
status: 200
file: response/path-2.json
- request:
url: ^/testpath/(.*)/test
query:
pathid: '1,2,5'
method: GET
response:
headers:
Content-Type: application/json
status: 200
file: response/path-3.json
但我无法让这个 URL 映射根据不同的参数组合正确传递不同的有效负载。
- 1 -> 有效载荷1
- 1,2 -> 有效载荷2
- 1,2,5 -> 有效载荷3
如何才能做到这一点?