DEV Community

Pedro Lopes
Pedro Lopes

Posted on

2 1

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!

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay