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

:symbolize_keys option in Oj.load #79

Closed
7even opened this issue Mar 22, 2013 · 1 comment
Closed

:symbolize_keys option in Oj.load #79

7even opened this issue Mar 22, 2013 · 1 comment

Comments

@7even
Copy link

7even commented Mar 22, 2013

Hello.

As far as I understand Oj.load supports a :symbol_keys option to force creating symbol keys in the output hashes. But it seems like most JSON parsers do the same thing with a :symbolize_keys option, and multi_json specifies that I have to use it to get symbol keys.

The sidekiq library in turn depends on this option to parse json to hashes with keys explicitly typecasted to strings. But I have configured oj to use symbol_keys: true by default, so it spits symbols instead and doesn't care about a :symbolize_keys option.

So the question is: wouldn't it be appropriate to make a synonym option :symbolize_keys to the already existing option :symbol_keys for compatibility with other libraries?

@7even
Copy link
Author

7even commented Mar 22, 2013

Sorry, just found that multi_json already has a workaround for this. It just doesn't work for me because I'm trying to override a true default from Oj.default_options with a false value. I'll submit an issue to multi_json then.

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

No branches or pull requests

1 participant