Skip to main content

schema_for

Function schema_for 

Source
pub fn schema_for<T: Schema + ?Sized + 'static>() -> (SchemaObject, SchemaRegistry)
Expand description

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

Useful outside OpenAPI; $refs point into #/components/schemas/, so this helper rewrites nothing and is intended for inspection and tests.