protoc-gen-go-json

command module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2023 License: MIT Imports: 7 Imported by: 0

README

protoc-gen-go-json

This is a protoc plugin that generates code to implement json.Marshaler and json.Unmarshaler using protojson.

Install

go get github.com/yvvlee/protoc-gen-go-json

Usage

protoc --go_out=. --go-json_out=. request.proto
Options
  • UseProtoNames={bool} - uses proto field name instead of lowerCamelCase name in JSON field names
  • UseEnumNumbers={bool} - emits enum values as numbers.
  • EmitUnpopulated={bool} - specifies whether to emit unpopulated fields
  • DiscardUnknown={bool} - unknown fields are ignored.
protoc --go-json_out=enums_as_ints=true,emit_defaults=true:.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL