13
olezhka
2y

What the sh*t is this kind of response?! One of my corporate department's internal API returns THIS.

LOOK AT IT. LOOK. "NULL". What are those malformed closing / ending brackets?!

(request headers have accept: application/json btw)

And, as a final "f*uck you", the "IPG_API_JOBD_NC_RESP_P_COLL" is returned as JSON object if response has one element to return, but will be JSON ARRAY if result has more than one element.

Good luck, you there with strongly typed languages..... Boils my blood 😅

Comments
  • 7
    I've had to integrate with an api that replied with jsons that had duplicate properties, but that's pretty funny how it's not even syntactically valid.

    For our case it worked on accident as long as the correct property occurred first as that's what the library would parse. When we mailed them about it they wrote us a guide - with code snippets - on how to fix it using string replace before parsing it. Bonus how it would break if they ever got rid of the duplicates.
  • 2
    At least the returning of an object or an array of objects is easy to handle in languages with support for sum types. But yes, it should just always return a list.
  • 0
    @ltlian lol! Hey here's a crutch DLC, use it it's a gift! 😅
  • 1
    @Oktokolo agreed and agreed
Add Comment