Yson.Schema.root

You're seeing just the macro root, go back to Yson.Schema module for more information.
Link to this macro

root(opts \\ [], list)

View Source (macro)

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.

Example

reverse_name = fn %{name: name} -> %{name: String.reverse(name)} end
root resolver: &reverse_name/1 do
  value(:name)
end