I'm using Parse, and trying to create a class with the Schema API which has a field of type Pointer. Here's what I'm doing:
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
This fails with the following error from the API:
{"code":135,"error":"type Pointer needs a class name"}
The Author class already exists. What am I doing wrong?
Figured it out. Use targetClass as the property name, not 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With