What problem does it solve?
Writing accurate OpenAPI documentation for Sentry API endpoints is error-prone: declared schemas often drift from what endpoints actually return, legacy api-docs JSON files conflict with drf-spectacular decorators, and promoting endpoints to PUBLIC involves non-obvious steps. This Skill captures those lessons so the declared schema matches runtime behavior.
Core Features & Use Cases
- @extend_schema Authoring: Write or fix class-level and method-level
@extend_schema decorators with correct tags, operation IDs, parameters, responses, and examples, reusing canonical entries from src/sentry/apidocs/parameters.py.
- Response Typing & Drift Correction: Specify response TypedDicts following the
XxxResponseOptional(TypedDict, total=False) mixin pattern, distinguish nullable (T | None) from absent (NotRequired[T]) fields, and fix type drift by diffing live endpoint responses against declared types.
- Legacy Migration & Public Promotion: Migrate legacy
api-docs/paths*.json files all-or-nothing per path, and promote PRIVATE/EXPERIMENTAL endpoints to PUBLIC by bumping publish_status, setting owner = ApiOwner.<TEAM>, and updating the ownership allowlist.
- Use Case: You need to make an internal Sentry endpoint public. The Skill guides you through typing the response, validating with
make build-api-docs and pnpm run validate-api-examples, and flipping the publish status in one coherent change.
Quick Start
Ask the agent to document and type a specific Sentry API endpoint with drf-spectacular, fix any type drift against the live response, and validate the generated OpenAPI spec.