Skip to main content

Module schema

Module schema 

Source
Expand description

JSON Schema metadata shared with OpenAPI 3.1 / JSON Schema 2020-12.

Types implement Schema. Composite schemas obtain child schemas through SchemaRegistry::subschema, which returns a $ref for named types and stores their definition exactly once. This keeps OpenAPI documents small (components are reused, not duplicated) and makes recursive types safe.

Structs§

SchemaConflict
Two distinct Rust types claimed the same component name.
SchemaObject
A JSON Schema object: a map of schema keywords.
SchemaRegistry
Collects named schema definitions while schemas are generated.

Constants§

COMPONENTS_REF_PREFIX
Prefix of component references in OpenAPI documents.

Traits§

Schema
Types that can describe themselves as JSON Schema.

Functions§

schema_for
Generate a self-contained schema for T, with named definitions under $defs.