|
1 |
| -/// Schema Version: 2024_11_05 |
2 |
| -#[cfg(feature = "2024_11_05")] |
3 |
| -#[path = "generated_schema/2024_11_05/mcp_schema.rs"] |
4 |
| -mod mcp_schema; |
| 1 | +macro_rules! define_schema_version { |
| 2 | + ( |
| 3 | + $feature:literal, |
| 4 | + $mod_name:ident, |
| 5 | + $schema_path:literal, |
| 6 | + $utils_path:literal, |
| 7 | + $schema_mod:ident, |
| 8 | + $utils_mod:ident |
| 9 | + ) => { |
| 10 | + #[cfg(feature = $feature)] |
| 11 | + #[path = $schema_path] |
| 12 | + mod $schema_mod; |
5 | 13 |
|
6 |
| -#[cfg(feature = "2024_11_05")] |
7 |
| -pub use mcp_schema::*; |
| 14 | + #[cfg(all(feature = "schema_utils", feature = $feature))] |
| 15 | + #[path = $utils_path] |
| 16 | + mod $utils_mod; |
8 | 17 |
|
9 |
| -#[cfg(all(feature = "schema_utils", feature = "2024_11_05"))] |
10 |
| -#[path = "generated_schema/2024_11_05/schema_utils.rs"] |
11 |
| -pub mod schema_utils; |
| 18 | + #[cfg(feature = $feature)] |
| 19 | + pub mod $mod_name { |
| 20 | + pub use super::$schema_mod::*; |
12 | 21 |
|
13 |
| -/// Schema Version: 2025_03_26 |
14 |
| -#[cfg(feature = "2025_03_26")] |
15 |
| -#[path = "generated_schema/2025_03_26/mcp_schema.rs"] |
16 |
| -mod mcp_schema; |
| 22 | + #[cfg(feature = "schema_utils")] |
| 23 | + pub mod schema_utils { |
| 24 | + pub use super::super::$utils_mod::*; |
| 25 | + } |
| 26 | + } |
| 27 | + }; |
| 28 | +} |
17 | 29 |
|
| 30 | +/// Latest MCP Protocol 2025_03_26 |
18 | 31 | #[cfg(feature = "2025_03_26")]
|
19 |
| -pub use mcp_schema::*; |
| 32 | +pub use mcp_2025_03_26::*; |
20 | 33 |
|
21 |
| -#[cfg(all(feature = "schema_utils", feature = "2025_03_26"))] |
22 |
| -#[path = "generated_schema/2025_03_26/schema_utils.rs"] |
23 |
| -pub mod schema_utils; |
| 34 | +#[cfg(feature = "2025_03_26")] |
| 35 | +define_schema_version!( |
| 36 | + "2025_03_26", |
| 37 | + mcp_2025_03_26, |
| 38 | + "generated_schema/2025_03_26/mcp_schema.rs", |
| 39 | + "generated_schema/2025_03_26/schema_utils.rs", |
| 40 | + __int_2025_03_26, |
| 41 | + __int_utils_2025_03_26 |
| 42 | +); |
24 | 43 |
|
25 |
| -/// Schema Version: draft |
26 |
| -#[cfg(feature = "draft")] |
27 |
| -#[path = "generated_schema/draft/mcp_schema.rs"] |
28 |
| -mod mcp_schema; |
| 44 | +#[cfg(feature = "2024_11_05")] |
| 45 | +define_schema_version!( |
| 46 | + "2024_11_05", |
| 47 | + mcp_2024_11_05, |
| 48 | + "generated_schema/2024_11_05/mcp_schema.rs", |
| 49 | + "generated_schema/2024_11_05/schema_utils.rs", |
| 50 | + __int_2024_11_05, |
| 51 | + __int_utils_2024_11_05 |
| 52 | +); |
29 | 53 |
|
30 | 54 | #[cfg(feature = "draft")]
|
31 |
| -pub use mcp_schema::*; |
32 |
| - |
33 |
| -#[cfg(all(feature = "schema_utils", feature = "draft"))] |
34 |
| -#[path = "generated_schema/draft/schema_utils.rs"] |
35 |
| -pub mod schema_utils; |
| 55 | +define_schema_version!( |
| 56 | + "draft", |
| 57 | + mcp_draft, |
| 58 | + "generated_schema/draft/mcp_schema.rs", |
| 59 | + "generated_schema/draft/schema_utils.rs", |
| 60 | + __int_draft, |
| 61 | + __int_utils_draft |
| 62 | +); |
36 | 63 |
|
37 | 64 | #[path = "generated_schema/protocol_version.rs"]
|
38 | 65 | mod protocol_version;
|
|
0 commit comments