Expand description
Β§GERMANIC
Machine-readable schemas for websites.
Β§Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 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
β
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");
}ModulesΒ§
- compiler
- Compilation from JSON to .grm.
- dynamic
- Dynamic compilation mode (Weg 3). Compiles JSON to .grm using runtime schema definitions.
- error
- Error types.
- generated
- Generated FlatBuffer bindings.
- mcp
- MCP server for AI agent integration.
- pre_
validate - Pre-validation: schema-agnostic size and depth limits.
- prelude
- Commonly used items for easy import.
- schema
- Schema traits for metadata and validation.
- schemas
- Schema definitions (Rust structs with macro).
- types
- Header and .grm format.
- validator
- Validation of JSON against schema.
Derive MacrosΒ§
- Germanic
Schema - Re-export of the derive macro for easy use.
Allows:
use germanic::GermanicSchema;