michalmuskala / jason

A blazing fast JSON parser and generator in pure Elixir.
Other
1.61k stars 169 forks source link

Configure Jason to parse keys as atoms by default for Phoenix #165

Closed VladislavNekto closed 1 year ago

VladislavNekto commented 1 year ago

How to do this

dennym commented 1 year ago

There i currently no option for that You have to pass this option into every decode call. The default handling is handled here.

Also as a reminder its impotant to know that atoms are not garbage collected in the BEAM and this could pose a attack vector when there is user input data input involved.

michalmuskala commented 1 year ago

@dennym pretty much covered it. An alternative could be to make a wrapper module around Jason that passes the required options and use that, rather than Jason directly. But yes, there's no global option to do this.

For the future - please use the elixir forum or StackOverflow for questions/help, where a wider community will be able to help you. We reserve the issues tracker for issues only. Thank you.