KiwiCodec.SchemaInterpreter (kiwi_codec v0.3.0)

Copy Markdown View Source

Interpreter for parsed Kiwi schemas without generated modules.

Prefer generated modules for application code. This interpreter is useful for tooling, inspection, and compatibility tests where schemas are loaded at runtime. For repeated calls, prepare the parsed schema once with prepare/1 to replace linear definition, message-field, and enum lookups with indexed lookups.

Summary

Functions

Builds reusable lookup indexes for repeated runtime interpretation.

Types

Functions

decode(schema, definition_name, binary)

@spec decode(schema(), String.t(), binary()) :: map() | String.t() | integer()

encode(schema, definition_name, value)

@spec encode(schema(), String.t(), map()) :: binary()

prepare(schema)

Builds reusable lookup indexes for repeated runtime interpretation.