Closed gburek-fastly closed 3 weeks ago
@gburek-fastly that was mainly a stopgap to avoid the extra complexity of messages with both optional and not-optional fields. If you would like to take a look at generating those fields, I would be happy to merge a PR to add support!
I am working on generating https://github.com/open-telemetry/opentelemetry-proto-go definitions that work in a tinygo runtime.
I have been able to successfully use protobuf-go-lite to generate reflection-less
MarshalProtoJSON
andUnmarshalProtoJSON
as seen in https://github.com/open-telemetry/opentelemetry-proto-go/compare/main...gburek-fastly:opentelemetry-proto-go:gburek/lite-optional-bug.However, the generated code does not build:
It appears that these messages (defined upstream in https://github.com/open-telemetry/opentelemetry-proto) have
optional
fields,min
,max
andsum
:It looks like protobuf-go-lite skips generation of these messages. Was there something about messages with optional fields that protoc-gen-go-json gets weird about?
What it would it look like to allow code generation for objects with optional fields? Could it be a feature flag?