Body Validation — Aquilia Documentation
Comprehensive guide and documentation for Body Validation in the Aquilia framework. View API reference, examples, and implementation patterns.
Controllers Body Validation Aquilia provides declarative request body validation using the @validate_body decorator. It integrates directly with Contracts to parse and enforce contracts on incoming payloads. The @validate_body Decorator The @validate_body decorator validates incoming request payloads before they reach the route handler. On success, it injects the validated dictionary as a body keyword argument. On validation failure, it returns a 422 Unprocessable Entity response containing the validation errors. Response: # body is fully validated and typed according to the Contract contract user = await self.user_service.create(**body) return Response.json( , status=201)`} /> Validation Faults Body validation issues trigger structured faults: Fault Class Fault Code HTTP Status Description ))} Controllers Overview )
Go to Homepage