1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! OpenAPI for Dioxus server functions.
//!
//! Pair [`api_get`] / [`api_post`] with [`build_openapi`] so paths never need
//! to be listed twice: the macros expand to Dioxus `#[get]`/`#[post]` **and**
//! inventory-register a utoipa path (with tags applied correctly for Scalar).
//!
//! # App setup
//!
//! ```toml
//! [dependencies]
//! dioxus-openapi = "0.1"
//!
//! [features]
//! server = ["dioxus/server", "dioxus-openapi/server"]
//! ```
//!
//! ```rust,ignore
//! use dioxus_openapi::{api_get, api_post, build_openapi, SpecOptions, TagMeta};
//!
//! #[api_get("/api/hello", tag = "demo")]
//! pub async fn hello() -> Result<String> { Ok("hi".into()) }
//!
//! const SPEC: SpecOptions = SpecOptions {
//! title: "My API",
//! version: "0.1.0",
//! description: Some("…"),
//! tags: &[TagMeta { name: "demo", description: Some("Demo routes") }],
//! };
//!
//! // GET /api/openapi.json
//! async fn openapi_json() -> axum::Json<utoipa::openapi::OpenApi> {
//! axum::Json(build_openapi(&SPEC))
//! }
//! ```
pub use ;
pub use ;
/// Re-export so macro expansions can `::dioxus_openapi::inventory::submit!`
/// without the app depending on `inventory` directly.
pub use inventory;