DDD.MCP.Json (vicander v0.1.1)

Copy Markdown View Source

Turns the result of a command, query or repository lookup into JSON.

Domain structs (aggregates, entities, value objects) are written with DDD.Serializer, so every field type has its JSON form (decimals and dates as text, enums as strings, nested entities as objects). Everything else is converted structurally. All fields are shown: a query that must hide something returns a map it built itself.

Summary

Functions

The JSON text of value.

A JSON-ready term (maps with string keys, lists, strings, numbers, booleans, nil).

Functions

encode(value)

@spec encode(term()) :: String.t()

The JSON text of value.

prepare(value)

@spec prepare(term()) :: term()

A JSON-ready term (maps with string keys, lists, strings, numbers, booleans, nil).