Sycophant.Serializable (sycophant v0.5.0)

Copy Markdown

Encodes Sycophant structs to plain, JSON-ready maps with a "__type__" discriminator. Decoding is handled by Sycophant.Serializable.Decoder, which is driven by each struct's Zoi schema (t/0).

Summary

Functions

Converts a Sycophant struct into a plain map with a __type__ discriminator.

Functions

to_map(tool)

@spec to_map(struct()) :: map()

Converts a Sycophant struct into a plain map with a __type__ discriminator.