axelor / axelor-open-platform

Open source Java framework for business application development

Home Page:http://axelor.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create api fails without descriptive error

andrewschmidt-a opened this issue · comments

curl --request PUT
--url https://{{HOST}}/ws/rest/com.axelor.contact.db.Contact
--header 'Accept: application/json'
--header 'Content-Type: application/json'
--header 'Cookie: JSESSIONID={{SESSIONID}}'
--data '{
"data": {
"firstName": "John",
"lastName": "Smith2",
"email": "j.smith@gmail.com"
}
}'

is causing an error of
{
"status": -1,
"data": {
"popup": true,
"title": "Internal Server Error",
"message": "com.axelor.contact.db.Contact"
}
}

How am I supposed to debug this error without more details?

Appears that the object in the docs does not exist in a production? I cant find contact (maybe I havent installed the right package....)

Anyhow a follow up is that posting an empty object does not work
curl --request PUT
--url https://{{HOST}}/ws/rest/com.axelor.apps.hr.db.Employee
--header 'Accept: application/json'
--header 'Content-Type: application/json'
--header 'Cookie: JSESSIONID='
--data '{
"data": {}
}'

but adding a non existant property will pass
curl --request PUT
--url https://{{HOST}}/ws/rest/com.axelor.apps.hr.db.Employee
--header 'Accept: application/json'
--header 'Content-Type: application/json'
--header 'Cookie: JSESSIONID='
--data '{
"data": { "_________" : "" }
}'