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

changes best_effort_json_encode to do not convert json to string #59

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

kajedot
Copy link

@kajedot kajedot commented Aug 11, 2023

When I was testing sending JSONs in arguments, I found out that everything is converted to the string. In consequence Seq, is interpreting JSON structures as a plain text. In this situation, we are loosing Seq features related to handling JSON data, like easy querying on JSON fields, folding, coloring etc. Therefore I changed best_effort_json_encode function. Now it is checking if a given parameter is a JSON object, and if it is, then it does not convert it to a string. If given argument is not a proper JSON structure (json.dumps throw TypeError), then it converts it to a string like it was before.

Before:
image

After:
image

I also added JSON objects to arguments in tests.

@tintoy tintoy merged commit 866c670 into tintoy:master Aug 11, 2023
@tintoy
Copy link
Owner

tintoy commented Aug 11, 2023

Thanks!

I'll publish a new package tomorrow morning 🙂

@kajedot kajedot deleted the do-not-encode-json branch August 11, 2023 14:11
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

3 participants