JPageResultValueConverter does not respect Newtonsoft json serializer naming strategy
@xuzhg is already working on this.
Since Feb 27, 2023.
- Dominant language
- C#
- Stars
- 505
- Forks
- 186
- PR merge metrics
- No merged PRs in 30d
Description
Assemblies affected
Microsoft.AspNetCore.OData Version="8.0.12"
Microsoft.AspNetCore.OData.NewtonsoftJson Version="8.0.12"
Describe the bug
In an asp.net core project (.NET 6) using NewtonsoftJson and using the extension method AddODataNewtonsoftJson() when returning a PageResult from a controller the JPageResultValueConverter does not respect the naming strategy used by newtonsoft.json as
the PageResult ToDictionary() method hard-codes the properties names in lowercase
Reproduce steps
Create a new asp.net core project (.NET 6), install newtonsoft json, set the naming strategy to be PascalCase and return a PageResult from a controller. It will be serialized with {"count" : x, "items": [...] } instead of {"Count" : x, "Items": [...] }
Expected behavior
I expected the newtonsoft json naming strategy to be respected
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.