Skip to main content

normalize_schema

Function normalize_schema 

Source
pub fn normalize_schema(v: Value) -> Value
Expand description

Rewrites a JSON Schema value in place: strips title and $schema recursively, drops format on non-string schemas, and adds additionalProperties: false to every object schema that doesn’t already declare one.

The transformation is idempotent — running it twice produces the same result — so it’s safe for the library to apply defensively even if the caller already normalized.