Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
ltlian2216211dI once got in touch with the maintainers of an API that did this, and their response was essentially "Rest is useless because nobody follows it". It's sort of poetic.
-
tosensei7549211di can actually imagine a use case where this is a legit and clean response: checking the status of a long-running task. your check went through successfully, but the task failed.
but i am 100% sure that this will never be the case in real life... i've seen too much to keep up such high hopes. -
Voxera11813211dThis is quite common unfortunately.
We have the same in the old api’s but we are slowly replacing them with new endpoints that use more correct http status codes. -
rantydev060070210d@tosensei I saw this for some in-house job runner: it was checking job status and if top-level was 200 - job runner is OK, but the job itself was busted.
And if top-level was not 200 - job runner was busted.
Later it was refactored to a better REST support, so /job/status actually only returned 200 when job was successful, and a lot of stuff became simpler. -
j0n4s5477210dLiterally every ducking day, I see API responses like this.
Even the azure openai API does this -
MammaNeedHummus4135210dOh I love these APIs
The response I got from the designer "the first Success tells you the response was successful and the second one says the status of the transaction" -
hjk1015768210d@tosensei tell have been telling this every time with examples of jobs like in rundeck.
The actual action: requesting details of the job is successful. However if the job failed it should state that in the payload but not pretend that the GET request failed. -
Voxera11813209d@tosensei even in that cade you can use different http status codes to indicate what type of problem it is where one indicates a problem with the check code another communication problem and a third that the job have failed. Or maybe multiple for each for better granularity.
A 200 means that all parts are OK.
Just found this HTTP response.
Status Code:
200 - OK
Body:
{
status: "success",
response:
{
status: "error",
}
}
rant