myco:api-endpoint-serializer-authoring
Installation
SKILL.md
API Endpoint and Serializer Authoring (apps/api)
A. Adding a Resource or Action Endpoint
1. Classify the endpoint type
- Resource endpoint (
GET /v1/sites/{id}/cameras): implies the resource exists; return HTTP 409 when the required product is absent. - Action endpoint: advisory; always return HTTP 200 with a
capability_not_availableenvelope when the capability is missing — never 404 or 409 for action endpoints.
2. Wire cursor-based pagination
Use Cursor and paginate() from
apps/api/src/unifi_api/services/pagination.py:
from unifi_api.services.pagination import Cursor, InvalidCursor, paginate