How Do You Handle Missing or Incorrect REST API JSON Response Data Keys in Your Applications?

14 Replies, 2094 Views

Honestly, I just assume the rest api json response data keys will be wrong half the time lol. I’ve started using a library called Zod for validation. It’s super flexible and lets you define schemas for your responses.

Also, if the API is super unreliable, I’ll sometimes reach out to the devs and ask them to fix their docs. It’s hit or miss, but worth a shot.

Messages In This Thread



Users browsing this thread: 1 Guest(s)