Skip to content
yutils
Example

Input (JSON)

{
  "id": 1,
  "name": "yutils",
  "active": true,
  "owner": { "email": "hello@yutils.dev", "verified": false }
}

Output (TypeScript types)

interface Root {
  id: number;
  name: string;
  active: boolean;
  owner: Owner;
}

interface Owner {
  email: string;
  verified: boolean;
}

Note

Nested objects become separate interfaces. Arrays are typed from their first element. Mixed nulls produce union types.

Usage / FAQ

When to use

  • Generate TypeScript types directly from a JSON API sample
  • Convert Postman / cURL results into ready-to-paste type code
  • Seed initial types when mocking an external SDK
  • Skip writing types by hand for a quick first draft
  • Auto-split deeply nested objects into named interfaces

FAQ

Q.How are interfaces named?
A.Top-level is `Root`; nested objects use the PascalCase form of their parent key. Rename in your editor afterwards if you prefer.
Q.Are optional fields detected?
A.A single JSON sample assumes every field is present. For union / optional inference across multiple samples, edit the result manually.
Q.Can it produce Zod or io-ts schemas?
A.Only plain TypeScript interfaces today. If you need runtime validation, convert the result into a Zod schema as a separate step.