What problem does it solve?
This Skill enforces consistent and predictable behavior for API fields, preventing common issues like mass assignment vulnerabilities, confusing null/absence semantics, and schema inconsistencies.
Core Features & Use Cases
- Null vs. Absence Distinction: Clearly defines and enforces the difference between a field being intentionally null and a field being absent.
- Field Behavior Annotations: Manages field states like REQUIRED, OPTIONAL, OUTPUT_ONLY, and IMMUTABLE.
- Schema Separation: Promotes the use of distinct Pydantic models for different API operations (create, update, patch, response) to enhance security and clarity.
- OpenAPI 3.1 Nullability: Correctly maps Pydantic models to OpenAPI specifications for robust API documentation.
- Use Case: When designing a new API endpoint, use this Skill to ensure that fields like
id are OUTPUT_ONLY and cannot be sent by the client, and that immutable fields like slug are protected from modification after creation.
Quick Start
Use the governing-field-lifecycle skill to review the nullability and behavior annotations for the 'user_id' field in the API response schema.