SpaceTradersAPI / issues-and-suggestions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Create an endpoint that returns status code errors for debugging

phyreman opened this issue · comments

It would be kind of nice to be able to get a response from an endpoint, say /debug/status and POST it a HTTP status code and get the expected response if that error actually occurred. So, say you send "400" in the body of a POST to /debug/status, it should respond with a 400 code, etc. It would work a lot like https://httpstat.us does, but would include the custom error messages (especially for teapotting and rate-limiting responses).

I'm not quite sure I follow or maybe I just think to narrowly that this fits better under the API documentation. The error responses are different depending on which endpoint you hit. There should be some common structure but each endpoint might return data specific to that endpoint. The issue #105 involves adding example responses for all endpoint. This should include both success and error responses. Something like in the image below. Note that the error is not fully filled out and that it's not live currently, I just added it real quick to give an example.

Would completion of the issue mentioned resolve what you had in mind or is there anything I'm missing?

image

Yeah that would actually resolve just what I had in mind, but your suggestion sounds a bit easier than my idea and still covers my issue.

Cool, I'll update the linked issue with some more information and close this one in favor of it. Thanks for pointing out areas in which spacetraders can improve!