Karate是切割相同名称字段名吗?

huangapple go评论51阅读模式
英文:

karate is cutting of same names fieldnames?

问题

我在想,卡拉特(Karate)是否在某种程度上进行了优化,查看 JSON 主体并使其更合适? Karate是切割相同名称字段名吗?

场景:

给定路径 'blubb'
和标头授权 = 'Bearer ' + blabla
和 URL bimbambom
和请求 { "properties": {"var1": '8.bg', "var1": '9.bg'}}
当方法为 POST

在黄瓜报告中,我看到了这个:
...
1 > 接受编码:gzip,deflate

{"properties":{"var1":"9.bg"}}

...

从逻辑角度来看,这是可以接受的,但我想测试这个用例 Karate是切割相同名称字段名吗?
我想知道,如果我提供这种类型的数据,服务会如何响应。

通过 Postman 发送这个主体是有效的。
也许你有一些想法。否则,我会在 Karate 中提出一个 bug 报告。

英文:

i am wondering if karate is doing somehow optimization stuff,
looking into json body and makes it more rightful ? Karate是切割相同名称字段名吗?

Scenario:

Given path 'blubb'
And header Authorization = 'Bearer '+ blabla
And url bimbambom
And request { "properties": {"var1": '8.bg', "var1": '9.bg'}}
When method POST

In the cucumber report i see this:
...
1 > Accept-Encoding: gzip,deflate

{"properties":{"var1":"9.bg"}}

...

From the logical viewpoint its ok, but i want to test this usecase Karate是切割相同名称字段名吗?
I wanted to know, how the service is reacting, if i am giving this kind of food.

Via postman it is working to sent this body as it is..
May you have some idea. Else i would open a bug in karate.

答案1

得分: 0

是的,这是无效的JSON。

你可以在这里找到解决方案,使用字符串或 text:https://stackoverflow.com/a/75376033/143475

另请参阅:https://stackoverflow.com/a/57014394/143475

英文:

Yes, that's invalid JSON.

You have a solution here, use a string or text: https://stackoverflow.com/a/75376033/143475

Also see: https://stackoverflow.com/a/57014394/143475

huangapple
  • 本文由 发表于 2023年3月7日 23:35:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/75664036.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定