diff --git a/acl/grpc/types_frostfs.pb.go b/acl/grpc/types_frostfs.pb.go index 2b116bdd..b0551673 100644 Binary files a/acl/grpc/types_frostfs.pb.go and b/acl/grpc/types_frostfs.pb.go differ diff --git a/ape/grpc/types_frostfs.pb.go b/ape/grpc/types_frostfs.pb.go index 216415b4..e19d9f69 100644 Binary files a/ape/grpc/types_frostfs.pb.go and b/ape/grpc/types_frostfs.pb.go differ diff --git a/netmap/grpc/types_frostfs.pb.go b/netmap/grpc/types_frostfs.pb.go index e7597ea1..43af1037 100644 Binary files a/netmap/grpc/types_frostfs.pb.go and b/netmap/grpc/types_frostfs.pb.go differ diff --git a/object/grpc/service_frostfs.pb.go b/object/grpc/service_frostfs.pb.go index dea1b5b7..188d0326 100644 Binary files a/object/grpc/service_frostfs.pb.go and b/object/grpc/service_frostfs.pb.go differ diff --git a/object/grpc/types_frostfs.pb.go b/object/grpc/types_frostfs.pb.go index 42334170..9fc27697 100644 Binary files a/object/grpc/types_frostfs.pb.go and b/object/grpc/types_frostfs.pb.go differ diff --git a/refs/grpc/types_frostfs.pb.go b/refs/grpc/types_frostfs.pb.go index 35febe91..5f35eba2 100644 Binary files a/refs/grpc/types_frostfs.pb.go and b/refs/grpc/types_frostfs.pb.go differ diff --git a/session/grpc/types_frostfs.pb.go b/session/grpc/types_frostfs.pb.go index 41ff5d9d..c92ab28b 100644 Binary files a/session/grpc/types_frostfs.pb.go and b/session/grpc/types_frostfs.pb.go differ diff --git a/util/proto/test/custom/test_frostfs.pb.go b/util/proto/test/custom/test_frostfs.pb.go index 97efa51c..005d6d11 100644 Binary files a/util/proto/test/custom/test_frostfs.pb.go and b/util/proto/test/custom/test_frostfs.pb.go differ diff --git a/util/protogen/internalgengo/json.go b/util/protogen/internalgengo/json.go index f7cd284d..95a06d59 100644 --- a/util/protogen/internalgengo/json.go +++ b/util/protogen/internalgengo/json.go @@ -195,7 +195,13 @@ func emitJSONFieldWrite(g *protogen.GeneratedFile, f *protogen.Field, name strin case protoreflect.BoolKind: template = "out.Bool(%s)" case protoreflect.EnumKind: - template = "out.Int32(int32(%s))" + enumType := fieldType(g, f).String() + template = `v := int32(%s) + if vv, ok := ` + enumType + `_name[v]; ok { + out.String(vv) + } else { + out.Int32(v) + }` case protoreflect.Int32Kind, protoreflect.Sint32Kind, protoreflect.Sfixed32Kind: template = "out.Int32(%s)" case protoreflect.Uint32Kind, protoreflect.Fixed32Kind: