英文:
karate is cutting of same names fieldnames?
问题
我在想,卡拉特(Karate)是否在某种程度上进行了优化,查看 JSON 主体并使其更合适?
场景:
给定路径 'blubb'
和标头授权 = 'Bearer ' + blabla
和 URL bimbambom
和请求 { "properties": {"var1": '8.bg', "var1": '9.bg'}}
当方法为 POST
在黄瓜报告中,我看到了这个:
...
1 > 接受编码:gzip,deflate
{"properties":{"var1":"9.bg"}}
...
从逻辑角度来看,这是可以接受的,但我想测试这个用例
我想知道,如果我提供这种类型的数据,服务会如何响应。
通过 Postman 发送这个主体是有效的。
也许你有一些想法。否则,我会在 Karate 中提出一个 bug 报告。
英文:
i am wondering if karate is doing somehow optimization stuff,
looking into json body and makes it more rightful ?
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
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论