Setting PropertyNamingPolicy to CamelCase caused deserialization to fail #2369
Unanswered
aaronpowell
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This was tested on the
v4branch at commit d706a6d, but can be replicated with 4.0.0-preview3I have a CosmosDB with documents that have camel-cased fields like
id,modelType,state, etc. and want to have them deserialized to .NET types with standard .NET naming conventions ofId,ModelType,State, etc.When setting the
PropertyNamingPolicyon theCosmosClientOptionsthe application fails to run, with an error inprivate IReadOnlyList<T> CreateQueryFeedResponseWithSerializer<T>with thefeedResponse.Valuebeingnull.Here's a sample document:
{ "id": "abc", "modelType": "game", "state": "WaitingForPlayers" }And working code:
But if I change it to this, it'll error:
Is this not how you're meant to override serialisation?
Beta Was this translation helpful? Give feedback.
All reactions