Examples
-
API sample
{"id":"550e8400-e29b-41d4-a716-446655440000","count":42}
About JSON to TypeScript
Writing interface definitions by hand from an API response is slow and easy to get wrong, especially for deeply nested payloads.
Paste a representative JSON sample and get a `Root` TypeScript interface you can drop straight into your codebase. Since types are inferred from exactly the sample you give it, merge a few different responses by hand if you need optional fields reflected accurately.
FAQ
- Are optional fields detected?
- Types reflect the sample you provide; union optional fields by merging multiple samples manually.