DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Pedro Lopes
Pedro Lopes

Posted on

Json client read

Never thought that this would happen in my developer lifetime with multiple clients at the same time.

Few months ago I developed a API for data integration with our systems and the API returns always a json data structure schema with 2 keys (output and message). Message key can have multiple string outputs, but output is always 0 (unsuccess) or 1 (success).

Two weeks ago I added a new key called guid that contains a uuid (Universally unique identifier), eg.:. 482b8a20-8108-11e8-adc0-fa7ae01bbebc, this implement wouldn't jam with output and/or with message. Suddenly clients said that they are having more output=1 than it is real (btw I track all outputs). So the stupid clients aren't parsing but instead doing a string search in the json schema, so for instance if something like this appears:

{β€œoutput”: 0,”message”:”something happened”,”txGuid”:”482b8a20-8108-11e8-adc0-fa7ae01bbebc”}

They will recognize as 1, since the schema has at least one 1 in the json schema.

I tought I have seen everything, but this is definitely a multiple first timer.

P.S API Documentation is explicit about json output!

Top comments (0)

New programmer and javascript

Stop by this week's meme thread!