跳到技能内容
词映 AI导航
发现工具选型指南Skills 技能AI 快讯AI图片AI视频AI文档AI办公AI助手AI搜索AI编程AI音频AI设计AI智能体模型与开发AI学习模型评测AI提示词内容检测AI金融AI 3D扫描与识别其他工具跨境电商 AI
词映 AI导航
工具库Skills 技能
我的收藏
词映 AI导航
发现工具选型指南Skills 技能AI 快讯AI图片AI视频AI文档AI办公AI助手AI搜索AI编程AI音频AI设计AI智能体模型与开发AI学习模型评测AI提示词内容检测AI金融AI 3D扫描与识别其他工具跨境电商 AI
Skills directory/kid-sid/codex-spellbook/python

Codex Validate Python Input with Pydantic and pytest

Model external mappings at a Python service boundary and test valid, missing, and out-of-range input.

中文

Install in Codex

Use a local Python project and its Pydantic and pytest versions.

  1. Copy the pinned `skills/python/` directory into `.agents/skills/python/` in the project.
  2. Read `pyproject.toml` in Codex and identify the target input model and error conventions.

Example task

Define `report_name` as text and `max_rows` as a positive integer. Test values 15, zero, and absent to document accepted and rejected input.

What to check

The model accepts valid data and returns field-specific validation errors for the other cases, with a repeatable test entry point.

Original SKILL.md on GitHub · Updated 2026-11-13

Frequently asked question

Should every internal object use Pydantic too?

Use runtime validation at external boundaries. A dataclass or typed mapping may suit controlled internal objects.

Related skills from this repository

  • Codex Validate External JSON in Strict TypeScript with Zod
Browse Codex skills in the Chinese directory
词映 AI 导航Skills 技能
工具分类全部工具已本地化技能选型指南AI 快讯