aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
diff options
context:
space:
mode:
authorJon Skeet <jonskeet@google.com>2016-11-03 09:24:29 +0000
committerJon Skeet <skeet@pobox.com>2016-11-03 18:05:59 +0000
commit50a37e0135c8dea723244b97b2fb76e56a5aece0 (patch)
treec9d0620d22ed0673be5cb272112d12f19a8dac66 /csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
parent93a4fa23d0e6d5c04d4c03aa0002fb483d7a77ee (diff)
downloadprotobuf-50a37e0135c8dea723244b97b2fb76e56a5aece0.tar.gz
protobuf-50a37e0135c8dea723244b97b2fb76e56a5aece0.tar.bz2
protobuf-50a37e0135c8dea723244b97b2fb76e56a5aece0.zip
Change JSON field name formatting
This affects cases with leading capital letters. This breaks compatibility with previous C# releases, but fixes compatibility with other implementations. See #2278 for details.
Diffstat (limited to 'csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs')
-rw-r--r--csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs2
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 6c6f6ee0..ed15d0e1 100644
--- a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
+++ b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs
@@ -97,7 +97,7 @@ namespace Google.Protobuf.Reflection
// We could trust the generated code and check whether the type of the property is
// a MapField, but that feels a tad nasty.
this.propertyName = propertyName;
- JsonName = Proto.JsonName == "" ? JsonFormatter.ToCamelCase(Proto.Name) : Proto.JsonName;
+ JsonName = Proto.JsonName == "" ? JsonFormatter.ToJsonName(Proto.Name) : Proto.JsonName;
}