Meme transcription:

Panel 1: Bilbo Baggins ponders, “After all… why should I care about the difference between int and String?

Panel 2: Bilbo Baggins is revealed to be an API developer. He continues, “JSON is always String, anyways…”

  • fibojoly@sh.itjust.works
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    3 days ago

    I feel this in my bones. As an OG dev, I had this incredible urge to smack people when I was working for my last job and I saw the API specs with everything being sent as strings through JSON. Boolean? Sure, let’s use a string. Integers? Sure we’ll do conversion in our code, that’ll be more efficient… So fucking infuriating. Oh and don’t get me started on JsonSchema T_T

      • fibojoly@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        38 minutes ago

        JsonSchema is a way to validate some JSON. A great thing when you want to stop any sort of malformed data from coming in. Instead of wrecking your head in your code testing whether this bit here is not null, or is that string a valid boolean (I still remember that shitty piece of code they had, ugh!) or that bit is empty or that one is an actual number, or a string that can only have such and such value, well, you can formalise all this in one place, as a data file instead of code. Very convenient.

        Except when it turns out you’re using a JSON library that’s not one, not two, but six major versions behind, and the security department won’t greenlight you using anything recent because… fuck you, that’s why. And to add insult to injury, we were the Quality department. Responsible for analysing the code quality of thousands of coders, around a hundred thousand programs (mostly COBOL but also C#), of a European banking group… The JSON schema was for adding a layer of non existant security to our API. But no, let’s keep accepting shitty malformed JSON (because of course we kept receiving shitty JSON; that’s why we wanted to implement this)

        So I had to rewrite a lot of custom code to patch the bugs we found in the library, and none of the nifty tools that let you put in json and generate json schema would work for us. Heck, they even have JsonSchema to validate your JsonSchema but those wouldn’t work either, so far behind our version was.

        Fucking awesome experience. I’m glad it’s behind me.