gpt4 book ai didi

django - EmberData 和 Django REST 框架之间的类型变化冲突

转载 作者:行者123 更新时间:2023-12-01 10:36:27 28 4
gpt4 key购买 nike

EmberDataPOST ing:

{
"data": {
"attributes": {
"name": "The project name",
"description": "The project description",
"price": 123
},
"relationships": {
"onwer": {
"data": null
}
},
"type": "projects"
}
}

Django ( drf 我猜)正在提示 409 Conflict :
{
"errors": {
"detail": "The resource object's type (projects) is not the type that constitute the collection represented by the endpoint (project)."
}
}

显然是 JSONApi规范 does not强制执行屈折规则。我怎么知道 drf接受复数的类型?

最佳答案

有一个config parameter :

JSON_API_PLURALIZE_RELATION_TYPE = True

关于django - EmberData 和 Django REST 框架之间的类型变化冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34589265/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com