| description | Use when writing or modifying OpenAPI specifications. Covers structure, naming, versioning, and documentation conventions for REST API definitions. | ||
|---|---|---|---|
| applyTo |
|
- Use OpenAPI 3.0.3 format
- Single source of truth for all REST API endpoints
- Keep in
server/openapi.yaml
- Group endpoints by tag matching feature domains
- Use
$reffor shared schemas — define once incomponents/schemas - No inline schema duplication across endpoints
- Use kebab-case for URL paths:
/api/align/{jobId}/status - Use camelCase for schema properties:
jobId,seedWeight - Use PascalCase for schema names:
AlignmentRequest,JobStatusResponse
- Mark required fields explicitly
- Use
readOnly/writeOnlywhere applicable - Prefer
enumfor fixed value sets (algorithms, formats, statuses) - Include
examplevalues for non-trivial fields - Use
formatfor well-known types:uuid,date-time,uri
- Document all possible status codes per endpoint
- Include error response schema with
errorstring field - Use
4xxfor client errors,5xxfor server errors
- Every endpoint must have
summary(short) anddescription(detailed) - Every parameter must have
description - Every schema property must have
description - Use
tagsto group endpoints by feature area
- No version prefix in URL paths — use header-based versioning if needed
- Ensure spec matches actual route implementations in
server/alignment/routes.ts - Keep spec and TypeScript types in sync — generate types from spec or vice versa