We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Before 0.9.0, a response like ExTwilio.Lookup.PhoneNumber had string keys in child maps like carrier, because Poison doesn't convert them to atoms:
ExTwilio.Lookup.PhoneNumber
carrier
iex> resp_str = "{\"add_ons\":null,\"caller_name\":null,\"carrier\":{\"name\":\"foo\",\"type\":\"bar\"},\"country_code\":\"US\",\"national_format\":\"blergh\",\"phone_number\":\"1234\",\"url\":\"abcd\"}" iex> Poison.decode!(resp_str, as: ExTwilio.Lookup.PhoneNumber.__struct__) %ExTwilio.Lookup.PhoneNumber{ add_ons: nil, caller_name: nil, carrier: %{"name" => "foo", "type" => "bar"}, country_code: "US", national_format: "blergh", phone_number: "1234", url: "abcd" }
but the corresponding Jason code does:
Jason
iex> struct(ExTwilio.Lookup.PhoneNumber, Jason.decode!(resp_str, keys: :atoms)) %ExTwilio.Lookup.PhoneNumber{ add_ons: nil, caller_name: nil, carrier: %{name: "foo", type: "bar"}, country_code: "US", national_format: "blergh", phone_number: "1234", url: "abcd" }
This should be called out in the changelog.
EDIT: removed unroutable private IP address from the example
The text was updated successfully, but these errors were encountered:
+1 to this, this just bit me too
Sorry, something went wrong.
No branches or pull requests
Before 0.9.0, a response like
ExTwilio.Lookup.PhoneNumber
had string keys in child maps likecarrier
, because Poison doesn't convert them to atoms:but the corresponding
Jason
code does:This should be called out in the changelog.
EDIT: removed unroutable private IP address from the example
The text was updated successfully, but these errors were encountered: