go-macaron / binding

Package binding is a middleware that provides request data binding and validation for Macaron.
Apache License 2.0
23 stars 17 forks source link

Automatically use jsonpb package for protobuf messages #24

Closed tamalsaha closed 5 years ago

unknwon commented 5 years ago

Thanks for the PR!

But this change require two extra dependencies for handling special cases. I do not think this is a good idea maybe?

tamalsaha commented 5 years ago

The standard "encoding/json" package does not operate correctly on protocol buffers, as stated here: https://godoc.org/github.com/golang/protobuf/jsonpb

We are using Protobuf generated Go structs for binding. So, this is required for our use-case.

FWIW, protobufs are becoming fairly common these days and golang/protobuf library has reached 1.0.0. So, it should be ok to depend on some stable library, IMHO.