azure-cosmos-dotnet-repository
azure-cosmos-dotnet-repository copied to clipboard
Patch Update not working when Serialization Options Property Naming Policy is set to Default.
Describe the bug When "propertynamingpolicy" in set to "Default" in SerializationOptions the SDK throws Bad Request Exception since its trying to find a property and could nt find. Sdk is not considering Serialization settings for PropertyNamingPolicy when creating PatchOperations.
Example : When configuration is set to "Default". Property name is "Name". But when trying to replace the value at "Name" property is searching for "name".
To Reproduce
Set "PropertyNamingPolicy" under "SerializationOptions" to Default.
Perform patch update using UpdateAsync
Expected behavior Successfully perform Patch update on document,
Actual behavior SDK throws 400 Bad request execption.
Environment summary SDK Version: 3.5.3 OS Version (Windows)
Hi 👋 @sushruthkumar123 Thank you so much for posting this issue. We really appreciate it. Could you please post the code to reproduce this bug, that would be really helpful to debug and fix the issue.
Hi @IEvangelist, please find the example here. Let me know if more details are required.
https://github.com/sushruthkumar123/azurecosmosrepository/tree/main/samples/patchUpdate/PatchUpdate
Hi @IEvangelist, please find the example here. Let me know if more details are required.
https://github.com/sushruthkumar123/azurecosmosrepository/tree/main/samples/patchUpdate/PatchUpdate
Hi @sushruthkumar123 and @IEvangelist
This is correct looking at the code it will not do what your expecting, we have some work to do on this one, in the meantime you can use the JsonProperty attribute to get around this and I'll try and get a fix in for this soon 👍🏼