DevToolsmith

Browser-based tools

Code Generators

Paste a representative sample and pick a target language. Generate the types, models or schema your application needs, then review them against the real contract.

From JSON

From YAML

From XML

Schemas

Common Codegen workflows

A generator infers a model from the examples it receives. Fields absent from the sample, optional values, number ranges and business rules are invisible to it. Start from several representative records, or from JSON Schema when you have a contract.

Generate models for your application

Start with representative sample JSON and select a target language. Verify inferred numbers, optional fields and nested types against the full API contract.

Create types and test fixtures

Infer a schema from sample JSON, validate it against another record, then generate a checked example. Language models and schemas are starting points: absent fields and business rules need your review.

Type a configuration file

Generate types from a YAML or XML sample, or infer a JSON Schema first and generate TypeScript from the schema for stricter required fields and enums.

  • YAML to TypeScript — Converts one YAML document through an exact JSON representation and reuses the existing model generators.
  • YAML to JSON Schema — Converts one YAML document through an exact JSON representation and reuses the existing model generators.
  • XML to TypeScript — Converts XML through the existing XML-to-JSON mapping, then reuses the model generators.
  • JSON Schema to TypeScript — Generate TypeScript types from a JSON Schema contract.

Large integers need an explicit type

JSON numbers beyond 2^53 lose precision in JavaScript, and a sample cannot show whether a value is an integer, a decimal or an ID. Check IDs and money values in the generated types.

A schema is a better source than a sample

JSON Schema states which fields are required and which values are allowed. Inference from a sample can only report what that sample contains.

Frequently asked questions

Are generated types complete?

No. A generator sees only the sample you paste. Optional fields, unions and values that never appear in the sample need your review, so treat the output as a starting point.

Why is a field typed as unknown or any?

The sample contained only null or an empty array for that field, so its type could not be inferred. Add a representative value or edit the generated type.

Tools process your input on this device. Read the privacy policy, or save the tool library for offline use.