axelor / axelor-open-platform

Open source Java framework for business application development
http://axelor.com
Other
391 stars 298 forks source link

Create api fails without descriptive error #115

Open andrewschmidt-a opened 2 years ago

andrewschmidt-a commented 2 years ago

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?

andrewschmidt-a commented 2 years ago

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": { "_____" : "" } }'