Skip to main content

write_schema

Function write_schema 

Source
pub fn write_schema(
    openapi: &OpenApi,
    path: impl AsRef<Path>,
) -> Result<(), SchemaError>
Expand description

Writes a deterministic schema atomically, creating parent directories when necessary.

The temporary file is created beside the destination so the final rename stays on the same filesystem.

ยงErrors

Returns a SchemaError when the document cannot be serialized, the parent directories or temporary file cannot be created, or writing, syncing or renaming the temporary file fails.