# `DDD.Serializer`
[🔗](https://github.com/blackuprise/vicander/blob/v0.1.1/lib/ddd/persistence/serializer.ex#L1)

Converts nested entities to JSON-ready maps and back.

Used by `DDD.Type` to store `{:list, Entity}`, `{:one, ValueObject}` and the other nested
field types in a `jsonb` column. `load/2` fills defaults for keys missing from old rows and
seals the rebuilt struct (the data is trusted, it came from the store).

# `dump`

```elixir
@spec dump(struct()) :: map()
```

Dump a struct to a map with string keys.

# `dump_value`

```elixir
@spec dump_value(term(), term()) :: term()
```

Dump a value of the given field type to a JSON-ready term.

# `load`

```elixir
@spec load(module(), map()) :: struct()
```

Rebuild a sealed struct of `module` from a dumped map (string or atom keys).

# `load_value`

```elixir
@spec load_value(term(), term()) :: term()
```

Load a value of the given field type from its dumped form.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
