yezyilomo / odoo-rest-api

Module which expose Odoo as a REST API
MIT License
209 stars 169 forks source link

returning HTTP 400 when threre is an error #35

Closed bluemix closed 4 years ago

bluemix commented 4 years ago

HTTP 200 is meant a success, otherwise, there is an error. So, I've changed error_response to return HTTP 400 in its JSON response.

yezyilomo commented 4 years ago

That was done purposely to adhere to JSON RPC protocol in order to have a uniform error schema, as for now it's not possible to change the status code for responses whose request's content type is application/json so doing so would make these request have a different error schema.

yezyilomo commented 4 years ago

Am closing this for now due to this

That was done purposely to adhere to JSON RPC protocol in order to have a uniform error schema, as for now it's not possible to change the status code for responses whose request's content type is application/json so doing so would make these request have a different error schema.