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
I have a JSON in the following format.
{ "person1": { "name": "name1" }, "person2": { "name": "name2" } }
defmodule Person do defstruct [:name] end
How do I specify as parameter to parse into Person struct?
as
Person
I cannot specify %Person{} since it would mean different thing:
%Person{}
> Poison.decode!(json, %Person{}) %{"person1" => %{"name" => "name1"}, "person2" => %{"name" => "name2"}}
I know that there is no support for things like as: {String, %Person{}}. Are there any workarounds?
as: {String, %Person{}}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have a JSON in the following format.
How do I specify
as
parameter to parse intoPerson
struct?I cannot specify
%Person{}
since it would mean different thing:I know that there is no support for things like
as: {String, %Person{}}
. Are there any workarounds?The text was updated successfully, but these errors were encountered: