-
Notifications
You must be signed in to change notification settings - Fork 915
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
Add a flag for allowing single quotes in JSON strings. #8144
Add a flag for allowing single quotes in JSON strings. #8144
Conversation
…n_object() to take an explicit options struct for controlling behaviors.
Pinging @jlowe for any input on the flipping of the logic (previously, default behavior was Spark-specific, now it is the opposite and the plugin will need to set |
Codecov Report
@@ Coverage Diff @@
## branch-21.06 #8144 +/- ##
===============================================
Coverage ? 82.84%
===============================================
Files ? 105
Lines ? 17865
Branches ? 0
===============================================
Hits ? 14800
Misses ? 3065
Partials ? 0 Continue to review full report at Codecov.
|
Stripping the quotes from a string seems like the right thing to do by default for JSON: const str = JSON.parse(`{"str":"foo"}`).str;
assert(str === `foo`) // str is `foo`, not `"foo"` |
As per Paul's comment, #8144 (comment) I have switched the default behavior for stripping quotes on single-string return values back to the way they were. Note: allowing single-quotes is still off by default, so the Spark plugin will need to toggle this on. |
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.
Looks good to me
Changing this to non-breaking as it won't alter existing behavior. |
@gpucibot merge |
Add a flag that allows
get_json_object()
to accept JSON with strings using single quotes. Also adds an explicitget_json_object_options
struct for allowing the user to customize what behaviors they want.Note: stripping quotes from individually returned string values has been left on as default.