تخطَّ إلى المحتوى
TakoAPI
العودة إلى المهارات

data-validation

بواسطة gitgoodordietrying

Web & Frontend Development
1.8kالتنزيلات وفق ما يذكره clawskills.sh
1النجوم
0المشاهدات
لا إعجاباتسجّل الدخول للإعجاب بهذه المهارة
—لم يُقيَّم بعد
تقييمك

موجز

Validate data with schemas across languages and formats.

الوصف

ما الذي تفعله هذه المهارة

Schema-based data validation across languages and formats. Covers JSON Schema, Zod for TypeScript, and Pydantic for Python. Handles API boundary validation, file integrity checks, and data migration verification.

Zod and Pydantic both generate JSON Schema from their definitions, so one schema serves validation, type inference, and API documentation simultaneously.

متى تستخدمها

  • Validating API request bodies before processing user input
  • Checking CSV column consistency before importing to a database
  • Verifying a data migration preserved all records and field values
  • Defining shared data contracts between microservices
  • Generating TypeScript types or OpenAPI specs from Zod/Pydantic schemas

مثال على سير العمل

الإدخال

User asks: validate incoming POST /api/users request bodies in an Express app

الوكيل
  1. 1

    Define a Zod schema for the expected user shape with email, name, and password constraints

  2. 2

    Add a route handler that calls safeParse on req.body

  3. 3

    Return a 400 with structured error issues if validation fails

  4. 4

    Destructure the validated, typed data from result.data for downstream logic

الإخراج

Express route that rejects malformed requests with field-level error messages and passes typed data to business logic

التثبيت

clawhub install gitgoodordietrying/data-validation

شغّل أمر واجهة سطر الأوامر، أو الصق النص في Claude Code أو Cursor أو Codex أو أي وكيل برمجة تستخدمه.

الروابط