You've done it. We all have. A new endpoint shows up. You curl it, get back eighty lines of nested JSON, and start typing: interface User { id: string name: string // wait, is `email` always present? } Twenty minutes later you've shipped it, ten minutes after that production is throwing Cannot read property 'name' of undefined because the API returns null for soft-deleted accounts, and you're
From JSON to TypeScript: Five Ways to Stop Hand-Writing Interfaces
Ashish Kumar·Dev.to··1 min read
D
Continue reading on Dev.to
This article was sourced from Dev.to's RSS feed. Visit the original for the complete story.