postman Strapi -验证错误400这必须是一个'object'类型,但最终值是:零

k4emjkb1  于 2023-02-04  发布在  Postman
关注(0)|答案(3)|浏览(244)

我尝试将一个json发布到Strapi API,但收到此错误"this must be a对象type, but the final value was: null ``
我的Json数据是:

{
    "data": [
        {
            "cveID": "CVE-2021-27104",
            "vendorProject": "Accellion",
            "product": "FTA",
            "vulnerabilityName": "Accellion FTA OS Command Injection Vulnerability",
            "dateAdded": "2021-11-03",
            "shortDescription": "Accellion FTA 9_12_370 and earlier is affected by OS command execution via a crafted POST request to various admin endpoints.",
            "requiredAction": "Apply updates per vendor instructions.",
            "dueDate": "2021-11-17"
        },
        {
            "cveID": "CVE-2021-27102",
            "vendorProject": "Accellion",
            "product": "FTA",
            "vulnerabilityName": "Accellion FTA OS Command Injection Vulnerability",
            "dateAdded": "2021-11-03",
            "shortDescription": "Accellion FTA 9_12_411 and earlier is affected by OS command execution via a local web service call.",
            "requiredAction": "Apply updates per vendor instructions.",
            "dueDate": "2021-11-17"
        }]
}

表模式如pic

中所示

w1jd8yoj

w1jd8yoj1#

在Python中,似乎需要首先进行序列化,然后在Strapi中获取它

json_string = json.dumps(to_post)
    data = json.loads(json_string)
2cmtqfgy

2cmtqfgy2#

您正在发送一个数组,请删除[],您的帖子将正常工作。

xn1cxnb4

xn1cxnb43#

我有一些混乱的关系域。错误消失后,我清除和重新建立关系。

相关问题