Yson.Schema.root
You're seeing just the macro
root
, go back to Yson.Schema module for more information.
Defines the root of the schema.
It contains the schema tree. A root field can be a value, a map, an interface or a reference.
Examples
root do
value(:name)
end
You can also specify custom resolver to parse data. It can be either a reference or an anonymous function.
Example
reverse_name = fn %{name: name} -> %{name: String.reverse(name)} end
root resolver: &reverse_name/1 do
value(:name)
end