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
Given something like,
defmodule Person do defstruct ~w(name)a end defmodule PersonSerializer do use Blazon.Serializable field name, :string field gender, enum: [type: :gender, ~w(male female)a], via: fn (person) -> if String.contains?("John") :male else :female end end end
We should produce an intermediate form like so:
iex(1)> Blazon.intermediate([PersonSerializer], [%Person{name: "John Doe"}, %Person{name: "Jane Doe"}]) {[[{:name, [type: :string], "John Doe"}, {:gender, [type: {:enum, [name: :gender], [:male, :female]}], :male}], [{:name, [type: :string], "Jane Doe"}, {:gender, [type: {:enum, [name: :gender], [:male, :female]}], :female}], [type: [People]]}
This will allow more structured serializers i.e. xml to provide proper type semantics.
xml
The text was updated successfully, but these errors were encountered:
I'm thinking a 3-arity tuple of the form {field, [attributes], generator} would make the most sense.
{field, [attributes], generator}
Sorry, something went wrong.
mtwilliams
No branches or pull requests
Given something like,
We should produce an intermediate form like so:
This will allow more structured serializers i.e.
xml
to provide proper type semantics.The text was updated successfully, but these errors were encountered: