POST 方法未向两个数据库表中插入数据
POST method is not inserting data into the two database tables
我正在使用 RestAssured 测试 API。
我有以下内容,我可以测试 post 方法吗?
{
"name": "Test",
"email": "test@email.com",
"occupation": [{
"id": 1,
"feature": {
"id": 2
},
"company": 7777,
}]
}
"Occupation" 是另一个 table,我怎么能在两个 table 上呢?
我试过这个:
.body("{\"name\": \"test\", \"email\": \"test@email.com\", \"occupation\": {\"id\": 15, \"feature\": {\"id\": 15}", \"company\": \"7777\"}}")
但是报错
"Can not deserialize instance of java.util.ArrayList out of
START_OBJECT token"
已显示。
{\"id\": 15, \"feature\": {\"id\": 15}", \"company\": \"7777\"}}"
在这里也尝试使用 JSON 数组!
f.e.:
[{\"id\": 1, \"feature\": {\"id\": 2}", \"company\": \"7777\"}]"
我正在使用 RestAssured 测试 API。
我有以下内容,我可以测试 post 方法吗?
{
"name": "Test",
"email": "test@email.com",
"occupation": [{
"id": 1,
"feature": {
"id": 2
},
"company": 7777,
}]
}
"Occupation" 是另一个 table,我怎么能在两个 table 上呢? 我试过这个:
.body("{\"name\": \"test\", \"email\": \"test@email.com\", \"occupation\": {\"id\": 15, \"feature\": {\"id\": 15}", \"company\": \"7777\"}}")
但是报错
"Can not deserialize instance of java.util.ArrayList out of START_OBJECT token"
已显示。
{\"id\": 15, \"feature\": {\"id\": 15}", \"company\": \"7777\"}}"
在这里也尝试使用 JSON 数组!
f.e.: [{\"id\": 1, \"feature\": {\"id\": 2}", \"company\": \"7777\"}]"