Skip to main content

oapi_codegen/lower/
mod.rs

1//! Lowering OpenAPI documents into the intermediate representation (IR).
2//!
3//! [`schema`] lowers component schemas into an [`crate::ir::Module`]. [`paths`]
4//! lowers operations into an [`crate::ir::Service`]. Both feed the emit pass.
5//! [`validate`] collects independent semantic problems so one run can report
6//! every problem it finds rather than aborting on the first.
7
8/// Lowering of the validation keywords a schema declares. Used by [`schema`] and
9/// [`paths`] only.
10pub(crate) mod constraints;
11/// Lowering of a schema `default`. Used by [`schema`] and [`paths`] only.
12pub(crate) mod default;
13pub mod direction;
14/// Readers for the `x-` extensions the generator understands.
15pub(crate) mod extension;
16pub mod paths;
17pub mod prune;
18pub mod recurse;
19pub mod rename;
20pub mod schema;
21pub mod security;
22pub mod servers;
23pub mod validate;
24
25pub use crate::lower::direction::split_by_direction;
26pub use crate::lower::paths::generate_service;
27pub use crate::lower::prune::prune_unused_models;
28pub use crate::lower::recurse::box_recursive_types;
29pub use crate::lower::rename::TypeNames;
30pub use crate::lower::rename::check_duplicate_models;
31pub use crate::lower::rename::check_prelude_shadowing;
32pub use crate::lower::rename::check_type_name_collisions;
33pub use crate::lower::rename::rewrite_service;
34pub use crate::lower::rename::type_renames;
35pub use crate::lower::schema::generate_models;
36pub use crate::lower::servers::lower_server_urls;
37pub use crate::lower::validate::Diagnostics;