Menu

Post image 1
Post image 2
1 / 2
0

Stop writing TypeScript interfaces by hand - generate them from JSON, CSV, and OpenAPI in one command

DEV Community·Nathmaxx·25 days ago
#6hPk76w1
Reading 0:00
15s threshold

You're integrating a third-party API. You open the docs, find a sample response, and start typing: interface Product { id : number ; name : string ; price : number ; // wait, is currency a string or an object? // what's the shape of variants[]? // does stock ever go null? } Enter fullscreen mode Exit fullscreen mode Twenty minutes later you have a fragile interface you're not fully confident in — and the moment the API ships a new field, it's already stale. There's a better way. snaptype: point it at the source, get types back snaptype is a CLI that generates TypeScript interfaces and Zod schemas by reading your actual data — live API endpoints, OpenAPI specs, JSON files, CSV files. No config. No code to write. One command. from-url — types straight from a live endpoint This is the one I use most.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More