src/google/protobuf: document UnmarshalJSON / API level behavior
For golang/protobuf#1657
Change-Id: Icdf7254bced1c0987ff2e969fd096d6eef3918f7
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/635139
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Cassondra Foesch <cfoesch@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/src/google/protobuf/go_features.proto b/src/google/protobuf/go_features.proto
index a7e14f8..a9cc792 100644
--- a/src/google/protobuf/go_features.proto
+++ b/src/google/protobuf/go_features.proto
@@ -19,6 +19,7 @@
message GoFeatures {
// Whether or not to generate the deprecated UnmarshalJSON method for enums.
+ // Can only be true for proto using the Open Struct api.
optional bool legacy_unmarshal_json_enum = 1 [
retention = RETENTION_RUNTIME,
targets = TARGET_TYPE_ENUM,
diff --git a/types/gofeaturespb/go_features.pb.go b/types/gofeaturespb/go_features.pb.go
index 61e3f76..e0b72ea 100644
--- a/types/gofeaturespb/go_features.pb.go
+++ b/types/gofeaturespb/go_features.pb.go
@@ -148,6 +148,7 @@
type GoFeatures struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Whether or not to generate the deprecated UnmarshalJSON method for enums.
+ // Can only be true for proto using the Open Struct api.
LegacyUnmarshalJsonEnum *bool `protobuf:"varint,1,opt,name=legacy_unmarshal_json_enum,json=legacyUnmarshalJsonEnum" json:"legacy_unmarshal_json_enum,omitempty"`
// One of OPEN, HYBRID or OPAQUE.
ApiLevel *GoFeatures_APILevel `protobuf:"varint,2,opt,name=api_level,json=apiLevel,enum=pb.GoFeatures_APILevel" json:"api_level,omitempty"`