diff options
Diffstat (limited to 'csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs index 8cfdb779..6083f171 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs @@ -94,7 +94,7 @@ namespace Google.Protobuf.Reflection /// <summary> /// The json_name option of the descriptor's target. /// </summary> - public string JsonName { get { return proto.JsonName; } } + public string JsonName { get { return proto.JsonName == "" ? JsonFormatter.ToCamelCase(proto.Name) : proto.JsonName; } } internal FieldDescriptorProto Proto { get { return proto; } } |