Poll: Do you believe it’s important to validate fetch call response shapes...


Poll: Do you believe it’s important to validate fetch call response shapes *at runtime* via tools like Zod, io-ts, etc?

(Remember, TypeScript doesn’t validate at runtime)

Please reply with when you think it’s important, or unnecessary.
My take? Runtime validation is useful if:
1. I’m calling an API I don’t control or trust
2. I’m not able to generate TypeScript types or an SDK from the API

It’s overkill if:
1. The front and backend share types in a monorepo
2. The frontend types are generated from the API

View original on X