• jj4211@lemmy.world
    link
    fedilink
    arrow-up
    13
    ·
    1 day ago

    I have had that argument repeatedly with people. People insisting that HTTP error codes are “transport layer” and it’s “wrong” for an API to hijack them to report “application level issues”.

    No, the whole point of “REST” was to map application semantics to HTTP in a way that actually normalizes some things like error handling and expectations around whether an operation could be expected to be idempotent and make the namespace navigable.

    At one point my work announced a person who was an external hire to be the ‘API genius’ to set my company straight. He came from a super reputable well known company so of course he just the smart guy to fix our technical mess. He had sent a message saying that he had reviewed the teams API and concluded they were not restful. I had a glimmer of optimism, that someone recognized as authoritative would call the RPC style HTTP usage that always returned 200 and steer toward sanity, or at least honesty. No, his feedback was that was all fine, but REST does not use JSON, REST uses Protobuf, so they need to change to Protobuf to claim to be REST. Of all the what the hell I could have predicted, that one was not in my book…

    • whoisearth@lemmy.ca
      link
      fedilink
      arrow-up
      1
      ·
      1 hour ago

      To further your point and remembering my asinine discussions with the vendor.

      Fine. I accept what they said. Then the return code should be a 5xx code not a 200.

      I genuinely wonder if they addressed their fuckups.

      Side note their updated desktop client (because of course new version didn’t have one so they had to write one fast) was a java client that needed 16gb of ram to run marginally well lol

    • RedFrank24@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 day ago

      A real “API Genius” would be complaining that your API doesn’t include HATEOAS, even though I’ve never once seen an API be used in that way, and few of the big tech APIs actually use it even though they call their APIs RESTful.

    • enumerator4829@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      1
      ·
      edit-2
      1 day ago

      The number of people talking about REST without having read the wikipedia page is astonishing. Roy Fielding’s dissertation on the subject might be of interest, but that’s from 2000 and absolutely not webscale.

      (Edit: /s if that wasn’t immediately obvious)

      • jj4211@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        22 hours ago

        It’s ok, as long as you make sure to use mongodb it will be webscale no matter what. But if you date use anything else, it won’t be.