-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
fix: trailing comma makes json invalid #4416
fix: trailing comma makes json invalid #4416
Conversation
Hello, just wondering
|
Hi, @Pranay-Pandey! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments appearing towards the end are stripped with the Pretiffy
action.
trailing-comments-removal-prettify.mov
6e8306e
to
f5782ea
Compare
Only the last occurrence is considered while specifying duplicate keys which is a behavior change.
0b60a89
to
bf25c57
Compare
bf25c57
to
d7a9db1
Compare
d7a9db1
to
eeb676c
Compare
3013d6f
to
641d6fb
Compare
Co-authored-by: Andrew Bastin <[email protected]> Co-authored-by: jamesgeorge007 <[email protected]>
Closes #4411
What's changed
This pull request fixes an issue where a trailing comma in a JSON object was causing the JSON to be invalid when we send it to the server. This was leading to errors when the JSON was being parsed.
The fix involves removing the trailing comma before sending it to the server, ensuring the JSON is correctly formatted and valid before proceeding request.
You may still have comments and trailing commas in your json body. That won't invalidate json because comments and trailing commas being stripped out before sending the request.
Notes to reviewers
Examples JSON body