Ada*_*ung 3 api rest schema parse-platform
我正在使用Parse,并尝试使用Schema API创建一个类,该类具有Pointer类型的字段.这是我正在做的事情:
curl -X POST \
-H "X-Parse-Application-Id: $PARSE_APP_ID" \
-H "X-Parse-Master-Key: $PARSE_APP_MASTER_KEY" \
-H "Content-Type: application/json" \
-d '
{
"className": "Article",
"fields": {
"heading": {
"type": "String"
},
"author": {
"type": "Pointer",
"classname": "Author"
}
}
}' \
https://api.parse.com/1/schemas/Article
Run Code Online (Sandbox Code Playgroud)
这会因API中的以下错误而失败:
{"code":135,"error":"type Pointer needs a class name"}
Run Code Online (Sandbox Code Playgroud)
Author类已经存在.我究竟做错了什么?
弄清楚了.使用targetClass作为属性名称,而不是className.
curl -X POST \
-H "X-Parse-Application-Id: $PARSE_APP_ID" \
-H "X-Parse-Master-Key: $PARSE_APP_MASTER_KEY" \
-H "Content-Type: application/json" \
-d '
{
"className": "Article",
"fields": {
"heading": {
"type": "String"
},
"author": {
"type": "Pointer",
"targetClass": "Author"
}
}
}' \
https://api.parse.com/1/schemas/Article
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
341 次 |
| 最近记录: |