okapi_operation/
lib.rs

1#![allow(rustdoc::bare_urls)]
2#![doc = include_str!("../docs/root.md")]
3
4pub use anyhow;
5#[doc(no_inline)]
6pub use okapi::{
7    self,
8    openapi3::OpenApi,
9    schemars::{self, JsonSchema},
10};
11#[cfg(feature = "macro")]
12#[doc(inline)]
13pub use okapi_operation_macro::openapi;
14
15#[cfg(feature = "axum")]
16pub mod axum_integration;
17
18use okapi::openapi3::Operation;
19
20pub use self::{
21    builder::OpenApiBuilder,
22    components::{Components, ComponentsBuilder},
23    to_media_types::ToMediaTypes,
24    to_responses::ToResponses,
25};
26
27mod builder;
28mod components;
29mod to_media_types;
30mod to_responses;
31
32/// Empty type alias (for using in attribute values).
33pub type Empty = ();
34
35// TODO: allow return RefOr<Operation>
36/// Operation generator signature.
37pub type OperationGenerator = fn(&mut Components) -> Result<Operation, anyhow::Error>;
38
39#[cfg(feature = "macro")]
40#[doc(hidden)]
41pub mod _macro_prelude {
42    pub use okapi;
43
44    pub use crate::{Components, ToMediaTypes, ToResponses};
45}