Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

Proposal: allow to map atoms to other values to handle null -> nil #154

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Overbryd
Copy link

@Overbryd Overbryd commented Dec 20, 2017

This is the best I could come up with, to handle JSON encoding for projects building upon a different world view (e.g. erlang dependencies classifying nil as null atoms).

Related to that is this question posted on Stackoverflow: https://stackoverflow.com/questions/47895651/how-to-extend-an-existing-protocol-in-elixir/47901896

Outline

As a user of a JSON encoding library, I want to be able to specify atoms to be mapped differently at will to incorporate custom encodings depending on the applications/dependencies needs.

This solves a problem I was having encoding JSON with input coming from an erlang library using :null to encode what should be nil in our world.

Funny side note: "Null References The Billion Dollar Mistake"

…shortcuts to Poison.encode(value, iodata: true)
@devinus devinus force-pushed the master branch 2 times, most recently from ee06841 to ee8336f Compare July 27, 2018 00:10
@devinus devinus force-pushed the master branch 20 times, most recently from 60defaa to db4e965 Compare July 23, 2021 00:46
@devinus devinus force-pushed the master branch 2 times, most recently from 29a475d to e0a080a Compare July 23, 2021 07:52
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

Successfully merging this pull request may close these issues.

None yet

1 participant