Replies: 2 comments 1 reply
-
Try making this change: [JsonSerializable(typeof(Person))]
+ [JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
internal partial class AppJsonSerializerContext : JsonSerializerContext
{
} (It wasn't clear to me which one was the one you expected, so I've edited this from |
Beta Was this translation helpful? Give feedback.
1 reply
-
Closing as this has been moved to #52088. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I've tried to switch with my microservice to Net8 Minimal API, for startup time and performance reason I've decided to use JsonSerializerContext, but I cannot achieve work solution, my simplest code for testing:
endpoint
/string
with manual serialization of course return (original field names):but
/json
returns result like normal serialization (camelCase field names):JsonSerializerContext not working at endpoint
/json
, resulted JSON should be the same like in/string
end pointproject configuration is default:
Beta Was this translation helpful? Give feedback.
All reactions