Skip to content

gogo jsonpb tries to serialize non proto field #305

@rogeralsing

Description

@rogeralsing

We have a proto generated struct which also contains a non proto field for caching purposes, like so

type PID struct {
	Address string `protobuf:"bytes,1,opt,name=Address,proto3" json:"Address,omitempty"`
	Id      string `protobuf:"bytes,2,opt,name=Id,proto3" json:"Id,omitempty"`

	p *Process //<-- this field
}

This works nice when serializing as a normal proto message.
But, when suing jsonpb, there is an error thrown that there is no encoder for Process.
Why is gogo jsonpb trying to serialize a field that is not part of the proto contract, has no proto tags and clearly is not a proto type?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions