Skip to main content

Module schema

Module schema 

Source
Expand description

schema_compaction (canonical transform id: "schema_compaction", version 1.0.0): a semantics-preserving transform for JSON payloads containing JSON-Schema-shaped fragments and/or OpenAI-style tool/function definitions.

It never drops required semantic information — description, required, enum, type, default, and name fields (and every other field) survive byte-for-byte. The only thing this transform ever shortens is illustrative "examples" arrays, which are truncated down to a configured maximum length wherever they appear in the document.

Enums§

SchemaCompactionError
Errors produced while compacting a schema/tool-definition payload.

Constants§

TRANSFORM_ID
Canonical stable id for this transform, as used in reports and --disable.
TRANSFORM_VERSION
Semantic version of this transform’s behavior (see crate::modes for the pipeline-wide version table this must stay in sync with).

Functions§

compact_schema
Parses input as JSON, truncates every "examples" array found anywhere in the document (object or array nesting, at any depth) down to at most max_examples elements — keeping the first max_examples elements in their original order — and re-serializes the result in compact form.