@hackage / proto-lens-jsonpb

JSON protobuf encoding for proto-lens

Latest0.2.2

About

Metadata

  • Last updated , by patrick_thomson
  • License BSD-3-Clause
  • Categories Web Development
  • Maintained by: timothy.clem@gmail.com

  • Lottery factor: 0

Links

Installation

Tested Compilers

  1. 9.4.2
  2. 9.2.4
  3. 8.10.1

Readme

proto-lens-jsonpb

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.

Requirements

  1. Install protoc (e.g., brew install protoc)
  2. Install the required protoc plugins:
    • cabal install proto-lens-protoc
    • go install github.com/tclem/proto-lens-jsonpb/protoc-gen-jsonpb_haskell

Usage

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