Type-Safe API Responses: Handling Polymorphic Data without 'any'
There is nothing more frustrating in API Type Design than a backend endpoint that changes its response shape based on runtime logic. One moment it returns a clean JSON object, and on error, it retu…