-
Notifications
You must be signed in to change notification settings - Fork 34
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
JSON #70
Comments
@equivalent Sorry for the late response but we can set the I think we definitely could add something like a |
Or maybe we move has formatting to a new |
I like the idea of
And |
It looks like the built in JSON library returns those as duplicate string keys (at least on Ruby 3.0) and converts numbers to strings. require 'json'
{ a: 'cheese', 'a' => 'burger', 1 => 'fries', 1.0 => 'version' }.to_json
# => "{\"a\":\"cheese\",\"a\":\"burger\",\"1\":\"fries\",\"1.0\":\"version\"}" |
I just realized it will only matter when you’re trying to copy paste it into a script or console. And then it’s probably just the last duplicate that wins (if not a syntax error). What I mean: You’ll still see all the keys if it’s simply used for (debug) logging. |
I started working on this a bit and realized we'll want Array to also use JSON format. I'm not sure if |
Closes #70 Replace :ruby19_syntax option with new :hash_format option that has three possible settings.
What about |
The main problem here would be nested objects that can't be easily converted to JSON friendly literals. This reminds me of the strict args Sidekiq introduced with Sidekiq 6 and now requires with version 7. |
love the gem, but is there a way how to print JSON format ? Meaning hash rocket
=>
replaced by:
, keys in quotes, ...) ?This would be useful when I want to copy paste amazing_printed output to a documentation for a FE developers.
The text was updated successfully, but these errors were encountered: