Peri.JSONSchema.Encoder (peri v0.8.2)
View SourceEncodes a Peri schema definition into a JSON Schema (Draft 7) map.
Field-level metadata attached via {:meta, type, opts} is read during
encoding and surfaced as JSON Schema annotation/format keywords. See
@meta_keys for the recognised vocabulary; unknown keys are dropped.
Dynamic Peri types (:dependent, :cond, :custom) cannot be expressed
statically. The :on_unsupported option controls the fallback:
:omit(default) — emit%{}(true schema):true_schema— same as:omit:raise— raisePeri.JSONSchema.Encoder.UnsupportedTypeError
Prefer Peri.to_json_schema/2 as the public entry point.
Summary
Types
Functions
@spec encode(Peri.schema(), opts()) :: map()