【发布时间】:2021-11-27 06:04:29
【问题描述】:
大家好,我想在 ROBOT Framework 中发布以下格式作为输入。
{
"Description": "School",
"Details": [
{
"name": "Test1",
"Surname": "XYZ"
},
{
"name1": "Test2",
"Surname2": "ABC"
}
]
}
但我收到以下错误
body={"Error":"module 'jsonschema._utils' has no attribute 'types_msg'"}
下面是我的代码
${tag_1} = create dictionary name="Test1" value"XYZ"
${tag_2} = create dictionary name="Test2" value"ABC"
${body} = create list Description="School" Details=[$tag_1,$tag_2]
${header}= create dictionary Authorization=%{TEMP_TOKEN} content-Type=application/json
${create_student}= post On Session ABCDE /input json=${body} headers=${header} expected_status=200
【问题讨论】:
-
字符串不需要引号。
name=Test1就足够了,您的引用可能会在以后引起问题。 -
什么是值“XYZ”?它作为字典键/值对无效,并且与您的 json 不匹配
标签: api unit-testing robotframework