Zemnmez / go-protobuf-marshalable-enums

project to make enums (json) marshalable in go protobuf implementations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-protobuf-marshalable-enums

What's this?

This package's intention is to make enums marshalable, at least as far as JSON is concerned in the two primary protobuf implementations for go: golang/protobuf and gogo/protobuf.

Why?

Protobufs make great generators for generic base types that are widely compatible. While enum types do have a canonical mapping in json, jsonpb only accepts proto.Message messages as marshalable JSON values..

How?

The intention is to make changes as minimal as possible to the packages. By the looks of it, it should be as simple as implementing EnumValue as with the other types jsonpb allows.

About

project to make enums (json) marshalable in go protobuf implementations


Languages

Language:Go 100.0%