Seals (Validation) — Aquilia Documentation
Comprehensive guide and documentation for Seals (Validation) in the Aquilia framework. View API reference, examples, and implementation patterns.
import useTheme from '../../../context/ThemeContext' import CodeBlock from '../../../components/CodeBlock' import FileCheck from 'lucide-react' import NextSteps from '../../../components/NextSteps' export function ContractsSeals() const theme = useTheme() const isDark = theme === 'dark' const boxClass = `p-6 rounded-2xl border $ isDark ? 'bg-[#0A0A0A] border-white/10' : 'bg-white border-gray-200' ` return ( Contracts / Seals & Validation Seals & Validation Sealing is Aquilia's term for validation. The is_sealed() method runs a multi-phase pipeline that progressively validates data — from raw type coercion through field constraints, cross-field rules, and async database checks. /* Validation Pipeline */ The Sealing Pipeline [ phase: 'Phase 1', name: 'Cast', desc: 'Each Facet coerces its raw input to the expected Python type. Failures produce CastFault.' , phase: 'Phase 2', name: 'Field Seals', desc: 'Each Facet runs its own seal() method — checking min/max, patterns, required, etc.' , phase: 'Phase 3', name: 'Cross-field Seals', desc: 'Methods named seal_*(data) receive the full validated dict for cross-field rules.' , phase: 'Phase 4', name: 'validate()', desc: 'Final synchronous hook for object-level validation. Can transform data.' , phase: 'Phase 5', name: 'Async Seals', desc: 'Methods named async_seal_*(data) for I/O-bound checks (uniqueness, external API, etc.)' , ].map((item, i) => ( item.phase item.name item.desc )) /* is_sealed() vs is_sealed_async() */ Sync vs Async Validation )
Go to Homepage