19
reincartor
193d

Just found this HTTP response.

Status Code:
200 - OK

Body:

{
status: "success",
response:
{
status: "error",
}
}

Comments
  • 3
    Slack API?
  • 7
    Mission failed successfully 👍
  • 2
    @netikras lol.
    Yeah.
  • 13
    I 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.
  • 12
    i 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.
  • 5
    *frontend developer screeching noises*
  • 2
    "It's a http response monad" 😆
  • 4
    This 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.
  • 2
    @useVim what is it, the universe's simulation source code or something?
  • 2
    @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.
  • 1
    Three words: GraphQL.
  • 1
    Literally every ducking day, I see API responses like this.
    Even the azure openai API does this
  • 1
    Oh 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"
  • 0
    @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.
  • 0
    @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.
Add Comment