From 50a37e0135c8dea723244b97b2fb76e56a5aece0 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 3 Nov 2016 09:24:29 +0000 Subject: 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. --- csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'csharp/src/Google.Protobuf/Reflection') 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; } -- cgit v1.2.3