mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2024-12-26 21:24:22 +00:00
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>
This commit is contained in:
parent
8edf9401bb
commit
4cf3399ed2
@ -19,6 +19,7 @@ extend google.protobuf.FeatureSet {
|
|||||||
|
|
||||||
message GoFeatures {
|
message GoFeatures {
|
||||||
// Whether or not to generate the deprecated UnmarshalJSON method for enums.
|
// 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 [
|
optional bool legacy_unmarshal_json_enum = 1 [
|
||||||
retention = RETENTION_RUNTIME,
|
retention = RETENTION_RUNTIME,
|
||||||
targets = TARGET_TYPE_ENUM,
|
targets = TARGET_TYPE_ENUM,
|
||||||
|
@ -148,6 +148,7 @@ func (GoFeatures_StripEnumPrefix) EnumDescriptor() ([]byte, []int) {
|
|||||||
type GoFeatures struct {
|
type GoFeatures struct {
|
||||||
state protoimpl.MessageState `protogen:"open.v1"`
|
state protoimpl.MessageState `protogen:"open.v1"`
|
||||||
// Whether or not to generate the deprecated UnmarshalJSON method for enums.
|
// 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"`
|
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.
|
// 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"`
|
ApiLevel *GoFeatures_APILevel `protobuf:"varint,2,opt,name=api_level,json=apiLevel,enum=pb.GoFeatures_APILevel" json:"api_level,omitempty"`
|
||||||
|
Loading…
Reference in New Issue
Block a user