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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//! Compile-time schema registration infrastructure
//!
//! This module provides the infrastructure for automatically registering OpenAPI schemas
//! at compile time using the `inventory` crate. When types are annotated with
//! `#[derive(Schema)]`, the macro automatically generates a `SchemaRegistration` entry
//! that is collected at compile time.
//!
//! # Example
//!
//! ```rust,ignore
//! use reinhardt_rest::openapi::{Schema, ToSchema};
//!
//! #[derive(Schema)]
//! pub struct User {
//! pub id: i64,
//! pub name: String,
//! }
//!
//! // The macro automatically generates:
//! // inventory::submit! {
//! // SchemaRegistration::new("User", User::schema)
//! // }
//! ```
use crateSchema;
/// Compile-time schema registration metadata
///
/// This struct holds metadata about a type that implements `ToSchema`.
/// Instances are collected at compile time via the `inventory` crate,
/// allowing the framework to discover all registered schemas without
/// explicit registration calls.
///
/// # Fields
///
/// * `name` - The schema name for $ref references (e.g., "User")
/// * `generator` - Function pointer to generate the schema
// Enable inventory collection for SchemaRegistration
//
// This allows the `#[derive(Schema)]` macro to submit instances:
// ```
// inventory::submit! {
// SchemaRegistration::new("TypeName", TypeName::schema)
// }
// ```
collect!;