frostyfan109 / tranql

A Translator Query Language
https://researchsoftwareinstitute.github.io/data-translator/apps/tranql
MIT License
0 stars 1 forks source link

Correct HTTP response codes for errors #111

Closed frostyfan109 closed 5 years ago

frostyfan109 commented 5 years ago

In the next commit, all api.py responses will now go through StandardAPIResource::response to be given a status code.

Currently, it gives everything an HTTP 200 status, but it should be giving any responses with a status property of Error an HTTP 500.

I think any responses with a status of Warning should stay as HTTP 200, as currently responses can only have this status if the request was still successful.

Also, the method could add a status such as Success to responses that are successful in order to standardize the structure of a response.