offstage/dynamic/encode
Types
An encoder for a specific type ‘t’ that knows how to convert it to a dynamic specification and contains the openapi specification of that type.
pub type Encoder(t) =
serialize.Encoder(t)
Values
pub fn encode(
a: a,
of encoder: serialize.Encoder(a),
) -> spec.Spec
Encode a value using the given encoder.
pub fn encode_json(
a: a,
of encoder: serialize.Encoder(a),
) -> json.Json
Directly encode a value using the given encoder to JSON.
pub fn encode_yaml(
a: a,
of encoder: serialize.Encoder(a),
) -> value.YamlValue
Directly encode a value using the given encoder to JSON.
pub fn map(
encoder: serialize.Encoder(a),
mapper: fn(b) -> a,
) -> serialize.Encoder(b)