Skip to content
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

Allow strict mode while parsing JSON content type #579

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zhiyuanliang-ms
Copy link
Contributor

@zhiyuanliang-ms zhiyuanliang-ms commented Jul 18, 2024

Why this PR?

#555

@zhenlan
Copy link
Contributor

zhenlan commented Jul 18, 2024

Unless you change the default, do you expect anyone to use it?

@amerjusupovic amerjusupovic linked an issue Jul 26, 2024 that may be closed by this pull request
throw new FormatException($"Invalid JSON value for key '{setting.Key}' with content type '{setting.ContentType}'. Please ensure the value is properly formatted JSON.");
}

logger.LogWarning($"Invalid JSON value for key '{setting.Key}' with content type '{setting.ContentType}'. Treated as a string value.");
Copy link
Member

@amerjusupovic amerjusupovic Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can mention the new API in this warning log? If we do change the default though, it would probably be mentioned in the exception instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add strict mode option for parsing of JSON values
3 participants