Turn decoded JSON into the structs described by the generated schemas.
Generated schema modules expose __fields__/1, a keyword list mapping each
field to its type. This module walks that description to build structs, lists
of structs and nested values.
Anything it cannot place is passed through untouched, so an outdated spec degrades to plain maps rather than losing data or crashing.
Summary
Functions
Decode value according to a generated type description.
Functions
Decode value according to a generated type description.
Type forms
{Module, :t}- build that struct[type]- a list of that type{:union, types}- best effort, see below- anything else - returned unchanged
Unions are ambiguous by nature. For a map, the candidate struct sharing the most field names with the payload wins; ties go to the leftmost candidate. For everything else the value passes through.