Quick hack to generate orphan ToJSON/FromJSON instances for proto-lens.
This requires the use of proto-lens to generate haskell datatypes from proto messages.
- Install
protoc
(e.g.,brew install protoc
) - Install the required protoc plugins:
cabal install proto-lens-protoc
go install github.com/tclem/proto-lens-jsonpb/protoc-gen-jsonpb_haskell
Use the protoc plugin to generate associated protobuf types from a proto file.
protoc -I=. --proto_path=./proto \
--plugin=protoc-gen-haskell=`which proto-lens-protoc` --haskell_out=./app \
--plugin=protoc-gen-jsonpb_haskell=./script/run-jsonpb_haskell --jsonpb_haskell_out=./app \
haberdasher.proto