Skillquality 0.45
litestar-dto-openapi
Auto-activate for MsgspecDTO, DTOConfig, litestar.dto, OpenAPIConfig, request body schemas, response DTOs, schema_extra, RequestEncodingType, or /schema output. Use when shaping Litestar DTOs, OpenAPI schemas, wire names, request encoding, or response models. Not for persistence
Price
free
Protocol
skill
Verified
no
What it does
Litestar DTO and OpenAPI
Use this skill for DTO selection, msgspec-first schemas, request/response typing, and OpenAPI shape.
Code Style Rules
- Prefer msgspec DTOs in Litestar apps unless the project is already Pydantic-led.
- Keep persistence models separate from API DTOs.
- Use camelCase wire names while Python stays snake_case.
- Exclude server-owned fields from write DTOs.
Quick Reference
- DTO patterns: dto.md
- Pair with litestar-data-services when mapping service results.
- Pair with msgspec for deeper Struct modeling.
Workflow
- Identify input, output, and persistence shapes separately.
- Choose msgspec DTOs or match the existing Pydantic stack.
- Configure excludes, partial updates, rename behavior, and media type.
- Check the generated OpenAPI schema.
Guardrails
- Do not leak internal persistence-only fields into write DTOs.
- Do not switch an existing Pydantic-heavy project to msgspec opportunistically.
- Do not rely on untyped dict payloads when request shape is known.
- Do not treat OpenAPI as documentation only; it is the contract.
Validation Checkpoint
- Request and response DTOs are explicit.
- Wire names match the API convention.
- Server-owned fields are excluded from writes.
- /schema output matches the intended contract.
Example
from litestar.dto import DTOConfig, MsgspecDTO
class UserWriteDTO(MsgspecDTO[UserWrite]):
config = DTOConfig(exclude={"id", "created_at"})
</example>
References Index
Official References
- https://docs.litestar.dev/ - Litestar documentation
- https://docs.litestar.dev/latest/reference/ - Litestar API reference
Shared Styleguide Baseline
Capabilities
skillsource-litestar-orgskill-litestar-dto-openapitopic-advanced-alchemytopic-agent-skillstopic-agentskillstopic-ai-agentstopic-claude-code-plugintopic-claude-code-skillstopic-gemini-cli-extensiontopic-htmxtopic-inertiatopic-litestartopic-mcptopic-python
Install
Installnpx skills add litestar-org/litestar-skills
Transportskills-sh
Protocolskill
Quality
0.45/ 1.00
deterministic score 0.45 from registry signals: · indexed on github topic:agent-skills · 7 github stars · SKILL.md body (2,080 chars)
Provenance
Indexed fromgithub
Enriched2026-05-18 19:13:53Z · deterministic:skill-github:v1 · v1
First seen2026-05-18
Last seen2026-05-18