Dynamic properties not serialized camelCase when using Microsoft Json.NET package #30454
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
feature-mvc-formatting
Needs: Attention 👋
This issue needs the attention of a contributor, typically because the OP has provided an update.
Milestone
Describe the bug
This is essentially a duplicate of #9543
It was locked there but no resolution was provided and solutions/workarounds that used to work with ASP.NET MVC 5 do not work anymore in ASP.NET Core.
The default System.Text.Json serializer does not support dynamics at all. We had to revert to using Json.NET via Microsoft's Nuget package Microsoft.AspNetCore.Mvc.NewtonsoftJson (v. 3.1.12) to get support for dynamic serialization.
Then enabled it like this
Comments for UseCamelCasing() specifically say
and
This does not work though. Properties for dynamic objects within a typed object remain PascalCase when serialized.
I think this warrants a revisit to the issue I linked above and a possible resolution.
To Reproduce
Here is an example what comes out of a serializer when provided with a dynamic object within a typed object:
Further technical details
The text was updated successfully, but these errors were encountered: