request-validation

Validate API request data against Zod and Pydantic schemas.

783|62|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/dadbodgeoff/drift --skill request-validation-dadbodgeoff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: request-validation
Source: https://github.com/dadbodgeoff/drift/tree/main/drift%20v1%20depreciated/skills/request-validation
Command: npx skills add https://github.com/dadbodgeoff/drift --skill request-validation-dadbodgeoff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents security vulnerabilities and improves user experience by ensuring that all incoming API requests conform to expected data formats and constraints, catching errors before they reach your business logic.

Core Features & Use Cases

  • Schema Validation: Define and enforce data structures for request bodies, query parameters, and route parameters using libraries like Zod (TypeScript) and Pydantic (Python).
  • Data Sanitization: Cleanse input data, such as trimming whitespace or sanitizing HTML.
  • Custom Validators: Implement specific validation rules for formats like phone numbers, slugs, or file uploads.
  • Use Case: When a new user signs up via your API, this skill ensures their provided email is valid, password meets complexity requirements, and name is within length limits, returning clear error messages if not.

Quick Start

Use the request-validation skill to validate the incoming request body against the createUserSchema.

Frequently Asked Questions about request-validation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate API request data using Pydantic and Zod?

Schema validation verifies that request bodies, query parameters, and route parameters match expected data formats and constraints. It catches invalid data early, preventing security vulnerabilities and ensuring reliable API processing.

How do I sanitize input data and enforce custom validation rules in an API?

You sanitize input data and enforce custom rules by defining specific validators within your schema. This allows you to trim whitespace, sanitize HTML, and validate custom formats like phone numbers or file uploads.

Does request validation work with both TypeScript and Python APIs?

Yes, request validation supports both TypeScript and Python APIs. It utilizes Zod for TypeScript environments and Pydantic for Python, accommodating common API development patterns across both languages.

What is the best way to secure APIs against invalid request bodies?

The best way to secure APIs is validating incoming request bodies against predefined schemas. This catches malformed data, enforces constraints like password complexity, and returns clear error messages before processing.

Can I validate route parameters and query strings, not just request bodies?

Yes, you can validate route parameters and query strings. The schema validation process supports enforcing data structures and constraints across request bodies, query parameters, and route parameters.

Why should I validate API request data before processing it in business logic?

Validating API request data before business logic prevents security vulnerabilities and improves user experience. It ensures all incoming requests conform to expected formats, catching errors early with clear messages.