Loading...
Loading...
Document and type a Sentry API endpoint. Write or fix @extend_schema decorators, specify response TypedDicts, type request parameters, correct type drift between the declared schema and the runtime response, and validate the generated spec. Use when asked to "document an endpoint", "add OpenAPI docs", "add/fix @extend_schema", "type an endpoint response", "fix the response type", "fix type drift", "reuse a response type", "split an overloaded endpoint", "specify the response schema", "add a TypedDict response", "migrate a legacy api-docs path", "fix a parameter type", or "make an endpoint public" / "promote an endpoint" (promotion is one section here).
npx skill4agent add getsentry/skills document-api-endpoint@extend_schema(tags=[...])OPENAPI_TAGS@extend_schema(operation_id=..., parameters=[...], responses={...}, examples=...)src/sentry/apidocs/parameters.pyexamples/*.pyowner = ApiOwner.<TEAM>api-docs/paths/**/*.jsonintcurl -s -H "Authorization: Bearer $TOKEN" "https://us.sentry.io/api/0/<endpoint>" | jq 'keys'XxxResponseOptional(TypedDict, total=False)T | NoneNotRequired[T]expand*_types.pydict[str, Any]cast# type: ignoreapi-docs/paths/**/*.json$refapi-docs/openapi.jsonAPPEND_PATHS@extend_schemapublish_status[<METHOD>]PUBLICowner = ApiOwner.<TEAM>API_OWNERSHIP_ALLOWLIST_DONT_MODIFYevent:readevent:{admin,read,write}permission_classes@sentry/apisentry-api-schemamake build-api-docs
pnpm run validate-api-examples
.venv/bin/pytest -q --reuse-db tests/apidocs/endpoints/<area>/test_<name>.py
.venv/bin/prek run -q --files <changed paths>