Microsoft/pydantic-models-py — Agent Skills | officialskills.sh
Back to skills

pydantic-models-py

officialdevelopment

Generates Pydantic v2 model sets following a multi-model pattern with Base, Create, Update, Response, and InDB variants.

Setup & Installation

npx skills add https://github.com/microsoft/skills --skill pydantic-models-py
or paste the link and ask your coding assistant to install it
https://github.com/microsoft/skills/tree/main/.github/plugins/azure-sdk-python/skills/pydantic-models-py
View on GitHub

What This Skill Does

Generates Pydantic v2 model sets following a multi-model pattern with Base, Create, Update, Response, and InDB variants. Designed for Python APIs that need consistent request/response schemas and database document types. Includes camelCase alias support and optional fields for PATCH endpoints.

Instead of hand-writing five related model classes per resource and remembering to keep them in sync, this skill scaffolds all variants from a single template with the correct field inheritance already wired.

When to use it

  • Defining API request bodies with required field validation for POST endpoints
  • Generating PATCH schemas where every field is optional by default
  • Adding camelCase aliases so Python models accept both snake_case and camelCase JSON
  • Creating Cosmos DB document models with a doc_type discriminator field
  • Exporting matching model sets for Base, Create, Update, Response, and InDB from a single template