explaingit

glideapps/quicktype

13,736TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

Reads JSON, JSON Schema, or API responses and automatically generates type-safe data classes and parsing code in over 20 languages including Python, Go, Swift, Kotlin, Rust, and TypeScript.

Mindmap

mindmap
  root((repo))
    What it does
      JSON to typed code
      Multi-language output
      Schema generation
    Inputs
      JSON files or URLs
      JSON Schema
      TypeScript types
    Output Languages
      Python Go Swift Kotlin
      Rust Java TypeScript
      C++ Dart and more
    Use Cases
      API integration
      Type-safe parsing
      Build pipeline codegen
    Audience
      Backend developers
      Mobile developers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Generate type-safe Python classes from a JSON API response without writing them by hand.

USE CASE 2

Create Go structs and deserialization code from a JSON Schema file for a new API integration.

USE CASE 3

Convert a TypeScript interface definition into equivalent Kotlin data classes for an Android project.

USE CASE 4

Set up a build pipeline that regenerates typed models for all languages in your stack from a single JSON Schema.

Tech stack

TypeScriptJavaScriptnpm

Getting it running

Difficulty · easy Time to first run · 5min
License information is not specified in the explanation.

In plain English

quicktype is a tool that reads JSON data and automatically writes the type definitions and parsing code you would normally write by hand. When a program receives JSON from an API, a developer typically needs to define classes or structs that match the JSON structure, then write code to convert between raw JSON text and those typed objects. quicktype does this generation automatically for more than 20 programming languages. You give quicktype a JSON file, a live API URL, a JSON Schema, a TypeScript definition, or a GraphQL query. It analyzes the structure and outputs ready-to-use code in whatever target language you choose. Supported output languages include Python, Go, Swift, Kotlin, Rust, Java, C#, C++, TypeScript, Dart, Scala, Ruby, Elm, Haskell, PHP, and several others. The generated code includes both the type definitions and the serialization and deserialization logic, so you can immediately read and write JSON in a type-safe way. A web interface at app.quicktype.io lets you paste or load JSON and see the generated code in any supported language without installing anything. The tool also works as a command-line program installed via npm, and as a JavaScript library you can call from your own build scripts. The recommended workflow for larger projects is to first generate a JSON Schema from your sample data, review and edit that schema to make it accurate, check it into your version control system, and then generate code from the schema during your build process. This way the schema becomes the single source of truth, and you can regenerate models for every language in your stack from the same definition. The project is open source. It is maintained under the quicktype GitHub organization, and community contributions adding new target languages are welcome per the README.

Copy-paste prompts

Prompt 1
I have a JSON response from an API and need Swift structs with decoding logic, show me how to use quicktype to generate them from the command line.
Prompt 2
Generate type-safe Python dataclasses from this JSON file using quicktype: [paste your JSON here].
Prompt 3
I want to create a JSON Schema from my sample API response, review it, then generate Kotlin data classes, walk me through the recommended quicktype workflow.
Prompt 4
Set up quicktype in a TypeScript project so it regenerates model classes from a schema file as part of the build process.
Prompt 5
Convert this TypeScript interface into equivalent Go structs with JSON deserialization using quicktype.
Open on GitHub → Explain another repo

← glideapps on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.