-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linq provider uses Newtonsoft.Json configuration for property naming even when a custom CosmosSerializer is provided #4321
Comments
There are two serializers
@mumby0168 Can you please test with the CosmosLinqSerializer which is currently in preview? |
Adding a note here that if you want to apply camel casing using the CosmosLinqSerializer, SerializeMemberName() will need to be updated accordingly, e.g. something like
|
@mumby0168 Just following up, did using the provided CosmosLinqSerializer address your concerns? |
@Maya-Painter |
@JarFrank thanks for checking. Yes, unless any valid concerns are brought up about the feature by users, we will include it as part of the next public release and update documentation accordingly. |
Closing this issue as addressed. This feature will also be released in the next public version - #4323 |
Describe the bug
I have followed the sample from the samples repository to setup a System.Text.Json
CosmosSerializer
and configured the provided options to use CamelCase as the naming policy.When I make a query to via the CosmosClient using the Linq provider the outputted query PascalCases the property queried.
For example if I wrote a document such as below:
I then used the cosmos client to make a query as below:
Then the ouputted query would be `select * from c where c.StoreNumber = 'q6`` unless I set the JsonPropertyAttribute on the class.
To Reproduce
Expected behavior
It should either have a way to change this, or some configuration to pass to the client for the linq provider to support different naming.
Actual behavior
Queries the database with the incorrect casing returning no results.
Environment summary
SDK Version:
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.36.0" />
OS Version (e.g. Windows, Linux, MacOSX)
Additional context
There is a workaround which is to set the [JsonProperty("storeNumber")] on the class used, however, this feels a strange quirk when the library has been setup to use System.Text.Json.
The text was updated successfully, but these errors were encountered: