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

Use IsValidJsonString, inplace of DetectIsJson - more reliable. #567

Merged
merged 2 commits into from Nov 9, 2023

Conversation

KevinJump
Copy link
Owner

inspired by #566 from @paulwoodland . stop using DetectIsJson because it can give you false positives.

instead, we are using IsValidJson in all places (outside of the actual extensions).

this can mean in some cases we end up parsing the json twice (once to detect it, and then later on when we actuall use it.

i wonder if we shoud really have a try parse ??

@KevinJump
Copy link
Owner Author

Added TryParseValidJsonString as a method so we can do the check and parse in one go, and make things run faster.

@KevinJump KevinJump merged commit 583c0ba into v12/main Nov 9, 2023
1 check passed
@KevinJump KevinJump deleted the v12/json-detection branch November 9, 2023 15:35
KevinJump added a commit that referenced this pull request Jan 23, 2024
* Use IsValidJsonString, inplace of DetectIsJson - more reliable.

* Move to a TryParseValidJsonString, to reduce the number of times we parse the json.
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.

None yet

1 participant