System.Text.Json, JsonSerializerOptions, PropertyNameCaseInsensitive #3470
Answered
by
phatboyg
shawnallen85
asked this question in
Q&A
-
|
What is the appropriate method for setting PropertyNameCaseInsensitive? I tried setting it with the following, but no luck: This is for a project where I don't have control over how the JSON is formatted. Error details: Class in question: JSON example: Thanks, |
Beta Was this translation helpful? Give feedback.
Answered by
phatboyg
Jun 26, 2022
Replies: 1 comment 1 reply
-
|
To configure the JSON serializer options used by MassTransit, use the code below. MassTransit has its own options, which aren't affected by whatever that configuration above does. cfg.ConfigureJsonSerializerOptions(options =>
{
options.PropertyNameCaseInsensitive = false;
return options;
});Oh, and this is within the |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
shawnallen85
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To configure the JSON serializer options used by MassTransit, use the code below. MassTransit has its own options, which aren't affected by whatever that configuration above does.
Oh, and this is within the
UsingRabbitMq((context, cfg) =>or whatever transport you're using.