germanic 0.2.3

Schema-validated binary data for AI agents. JSON to .grm compiler with zero-copy FlatBuffers.
Documentation
//! # 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 germanic_macros::GermanicSchema;

// ============================================================================
// MODULES
// ============================================================================

/// Generated FlatBuffer bindings.
///
/// Contains types generated by `flatc`:
/// - `generated::praxis::de::gesundheit::{Praxis, Adresse}`
/// - `generated::meta::germanic::common::{GermanicMeta, Signatur, Hinweis}`
pub mod generated;

/// Schema definitions (Rust structs with macro).
///
/// Contains manually defined schemas:
/// - `schemas::practice::{PracticeSchema, AddressSchema}`
pub mod schemas;

/// Schema traits for metadata and validation.
pub mod schema;

/// Error types.
pub mod error;

/// Header and .grm format.
pub mod types;

/// Compilation from JSON to .grm.
pub mod compiler;

/// Dynamic compilation mode (Weg 3).
/// Compiles JSON to .grm using runtime schema definitions.
pub mod dynamic;

/// Pre-validation: schema-agnostic size and depth limits.
pub mod pre_validate;

/// Validation of JSON against schema.
pub mod validator;

/// MCP server for AI agent integration.
#[cfg(feature = "mcp")]
pub mod mcp;

// ============================================================================
// PRELUDE
// ============================================================================

/// Commonly used items for easy import.
///
/// ```rust,ignore
/// use germanic::prelude::*;
/// ```
pub mod prelude {
    pub use crate::GermanicSchema;
    pub use crate::error::{GermanicError, ValidationError};
    pub use crate::schema::{SchemaMetadata, Validate};
    pub use crate::schemas::{AdresseSchema, PraxisSchema};
}