Code generator for JSON schema
Switch branches/tags
Nothing to show
Clone or download
fiorix Add travis-ci integration
Using macOS in travis-ci because homebrew has thrift 0.11 while latest
ubuntu has thrift 0.9, which won't compile the generated thrift spec.
Latest commit 3ece5e3 Sep 9, 2018


Build Status

jsonschema2go is a code generator for JSON schemas. Supports schemas from local files or URL, and generates Go code, or thrift spec.

This is a very naive and incomplete implementation. I wrote this code specifically to codegen the NVD JSON schema, based on a few requirements:

  • The output is a single file
  • Consistent output given same input
  • Capable of generating at least Go and Thrift

Download, install

Requires Go 1.10 or newer. The generated thrift spec requires thrift compiler 0.11 or newer.

Assuming you have a working Go environment:

go get
go install

Output binary is $GOPATH/bin/jsonschema2go.


Generate Go code:

jsonschema2go -gen go

Generate Thrift spec:

jsonschema2go -gen thrift