quicktype infers types from sample JSON data, then outputs strongly typed models and serializers for working with that data in your desired programming language. In short, quicktype makes it a breeze to work with JSON type-safely. For more explanation, read A first look at quicktype.
Try quicktype in your browser at app.quicktype.io.
- JSON
- JSON Schema
- GraphQL queries
- JSON URLs
- C#
- Go
- C++
- Java
- TypeScript
- Swift
- Elm
- JSON Schema
- Simple Types
$ npm install
$ npm run build
$ script/quicktype # rebuild and runInstall Visual Studio Code, open this workspace, and install the recommended extensions:
$ code . # opens in VS CodeWhen working on an output language, you'll want to view generated
output as you edit. Use npm start to watch for changes and
recompile and rerun quicktype for live feedback. For example, if you're
developing a new renderer for fortran, you could use the following command to
rebuild and reinvoke quicktype as you implement your renderer:
$ npm start -- "--lang fortran test/inputs/json/samples/bitcoin-block.json"The command in quotes is passed to quicktype, so you can render local .json
files, URLs, or add other options.
quicktype has a lot of complicated test dependencies:
swiftcompilerdotnetcoreSDK- Java, Maven
elmtoolsg++C++ compilergolangstack
We've assembled all of these tools in a Docker container that you build and test within:
$ script/dev
# ... Docker will build the image and start a bash shell
$ npm run test$ FIXTURE=golang npm test