proto-lens-jsonpb: JSON protobuf encoding for proto-lens

[ bsd3, library, program, web ] [ Propose Tags ]

Please see the README on GitHub at https://github.com/tclem/proto-lens-jsonpb#readme


[Skip to Readme]
Versions [faq] 0.1.0.0, 0.2.0.0
Dependencies aeson (>=1.4.5.0 && <1.5), attoparsec (>=0.13.2.3), base (>=4.7 && <5), base64-bytestring (>=1), bytestring (>=0.10.8), proto-lens-runtime (>=0.5 && <0.7), text (>=1.2.4.0 && <1.3), vector (>=0.12.0.3) [details]
License BSD-3-Clause
Copyright 2019 Timothy Clem
Author Timothy Clem
Maintainer timothy.clem@gmail.com
Category Web
Home page https://github.com/tclem/proto-lens-jsonpb#readme
Bug tracker https://github.com/tclem/proto-lens-jsonpb/issues
Source repo head: git clone https://github.com/tclem/proto-lens-jsonpb
Uploaded by tclem at Wed Nov 6 00:06:39 UTC 2019
Distributions NixOS:0.2.0.0
Downloads 51 total (51 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2019-11-06 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for proto-lens-jsonpb-0.2.0.0

[back to package description]

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 get 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