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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//! # GERMANIC
//!
//! Machine-readable schemas for websites.
//!
//! ## Architecture
//!
//! ```text
//! ┌─────────────────────────────────────────────────────────────────────────────┐
//! │ GERMANIC ARCHITECTURE │
//! ├─────────────────────────────────────────────────────────────────────────────┤
//! │ │
//! │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
//! │ │ Schema │ │ Compiler │ │ .grm │ │
//! │ │ (Rust + FB) │ ──→ │ (validate │ ──→ │ File │ │
//! │ │ │ │ + compile) │ │ │ │
//! │ └─────────────┘ └─────────────┘ └─────────────┘ │
//! │ │ │ │ │
//! │ ▼ ▼ ▼ │
//! │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
//! │ │ JSON Input │ │ Validation │ │ Website │ │
//! │ │ (from Plugin) │ + Signature │ │ /data.grm │ │
//! │ └─────────────┘ └─────────────┘ └─────────────┘ │
//! │ │
//! │ DATA FLOW: JSON → Rust Struct → FlatBuffer → .grm with Header │
//! │ │
//! └─────────────────────────────────────────────────────────────────────────────┘
//! ```
//!
//! ## Usage
//!
//! ```rust,ignore
//! use germanic::GermanicSchema;
//! use serde::Deserialize;
//!
//! #[derive(GermanicSchema, Deserialize)]
//! #[germanic(schema_id = "de.gesundheit.praxis.v1")]
//! pub struct PracticeSchema {
//! #[germanic(required)]
//! pub name: String,
//! pub telefon: Option<String>,
//! }
//!
//! fn main() {
//! let json = r#"{"name": "Dr. Müller", "telefon": "+49 123 456"}"#;
//! let practice: PracticeSchema = serde_json::from_str(json).unwrap();
//!
//! // Validation
//! use germanic::schema::Validate;
//! practice.validate().expect("Validation failed");
//! }
//! ```
extern crate self as germanic;
// ============================================================================
// RE-EXPORTS
// ============================================================================
/// Re-export of the derive macro for easy use.
/// Allows: `use germanic::GermanicSchema;`
pub use GermanicSchema;
// ============================================================================
// MODULES
// ============================================================================
/// Generated FlatBuffer bindings.
///
/// Contains types generated by `flatc`:
/// - `generated::praxis::de::gesundheit::{Praxis, Adresse}`
/// - `generated::meta::germanic::common::{GermanicMeta, Signatur, Hinweis}`
/// Schema definitions (Rust structs with macro).
///
/// Contains manually defined schemas:
/// - `schemas::practice::{PracticeSchema, AddressSchema}`
/// Schema traits for metadata and validation.
/// Error types.
/// Header and .grm format.
/// Compilation from JSON to .grm.
/// Dynamic compilation mode (Weg 3).
/// Compiles JSON to .grm using runtime schema definitions.
/// Pre-validation: schema-agnostic size and depth limits.
/// Validation of JSON against schema.
/// MCP server for AI agent integration.
// ============================================================================
// PRELUDE
// ============================================================================
/// Commonly used items for easy import.
///
/// ```rust,ignore
/// use germanic::prelude::*;
/// ```