Closed kumbhare closed 7 years ago
Given that property names in javascript/json are case sensitive, the serialization of operations to json should honor the supplied ContractResolver instead of always returning in lower case
https://github.com/aspnet/JsonPatch/blob/dev/src/Microsoft.AspNetCore.JsonPatch/JsonPatchDocumentOfT.cs#L718
718 private string GetPath<TProp>(Expression<Func<TModel, TProp>> expr) 719 { 720 return "/" + GetPath(expr.Body, true).ToLowerInvariant(); 721 }
https://github.com/aspnet/JsonPatch/blob/dev/src/Microsoft.AspNetCore.JsonPatch/JsonPatchDocumentOfT.cs#L776 private string GetPropertyNameFromMemberExpression(MemberExpression memberExpression) uses the contract resolver correctly, but the GetPath function above forces it to lower case.
private string GetPropertyNameFromMemberExpression(MemberExpression memberExpression)
Neither JSON patch: https://tools.ietf.org/html/rfc6902 nor JSON Pointer: https://tools.ietf.org/html/rfc6901 require it to be lower case, so letting developers control the case through would be a good idea
Given that property names in javascript/json are case sensitive, the serialization of operations to json should honor the supplied ContractResolver instead of always returning in lower case
https://github.com/aspnet/JsonPatch/blob/dev/src/Microsoft.AspNetCore.JsonPatch/JsonPatchDocumentOfT.cs#L718
https://github.com/aspnet/JsonPatch/blob/dev/src/Microsoft.AspNetCore.JsonPatch/JsonPatchDocumentOfT.cs#L776
private string GetPropertyNameFromMemberExpression(MemberExpression memberExpression)
uses the contract resolver correctly, but the GetPath function above forces it to lower case.Neither JSON patch: https://tools.ietf.org/html/rfc6902 nor JSON Pointer: https://tools.ietf.org/html/rfc6901 require it to be lower case, so letting developers control the case through would be a good idea