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
8mod all_of;
9/// Lowering of the validation keywords a schema declares. Used by [`schema`] and
10/// [`paths`] only.
11pub(crate) mod constraints;
12/// Lowering of a schema `default`. Used by [`schema`] and [`paths`] only.
13pub(crate) mod default;
14pub mod direction;
15/// Readers for the `x-` extensions the generator understands.
16pub(crate) mod extension;
17pub mod paths;
18pub mod prune;
19pub mod recurse;
20pub mod rename;
21pub mod schema;
22pub mod security;
23pub mod servers;
24pub mod validate;
25
26pub use crate::lower::direction::split_by_direction;
27pub use crate::lower::paths::generate_service;
28pub use crate::lower::prune::prune_unused_models;
29pub use crate::lower::recurse::box_recursive_types;
30pub use crate::lower::rename::TypeNames;
31pub use crate::lower::rename::check_duplicate_models;
32pub use crate::lower::rename::check_prelude_shadowing;
33pub use crate::lower::rename::check_type_name_collisions;
34pub use crate::lower::rename::rewrite_service;
35pub use crate::lower::rename::type_renames;
36pub use crate::lower::schema::generate_models;
37pub use crate::lower::servers::lower_server_urls;
38pub use crate::lower::validate::Diagnostics;