Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API Specification Practices for ROOST Projects

This document outlines minimum expectations for API specification across ROOST projects.

API documentation standard

ItemDescription/NotesPriority
Specification formatROOST projects with HTTP/REST APIs use the OpenAPI Specification (OAS). Projects using gRPC, GraphQL, or event-driven APIs should use their respective native spec formats (Protocol Buffers, GraphQL SDL, AsyncAPI)P0
Spec locationROOST convention: spec files live in the repo root or a docs/ directory and are referenced in the READMEP0
Spec accuracyROOST convention: the spec reflects the current state of the API. Whether the project takes a design-first (spec is source of truth) or code-first (spec is generated from code) approach, spec updates are required as part of any PR that changes API surfaceP0

Spec validation

ItemDescription/NotesPriority
Linting in CIOpenAPI spec is validated in CI (e.g. Spectral, Redocly CLI)P1
Breaking change detectionCI flags breaking API changes (removed endpoints, changed response shapes). More relevant once projects have downstream consumers depending on API stability (e.g. Osprey post-1.0). Tools: oasdiff, openapi-diffP2

Documentation generation

ItemDescription/NotesPriority
Generated docsHuman-readable API docs are generated from the spec (e.g. Redoc, Swagger UI)P2
Hosted docsGenerated docs are published and linked from the READMEP2

Versioning

ItemDescription/NotesPriority
API versioning strategyHow are API versions communicated? (URL path, header, etc.)P1
Deprecation noticesDeprecated endpoints are marked in the spec before removalP1

Idempotency

ItemDescription/NotesPriority
Idempotency for mutating operationsDocument which POST, PUT, and PATCH endpoints are idempotent. Non-idempotent POST endpoints should support an idempotency key to allow safe client retriesP1

Non-HTTP APIs

ItemDescription/NotesPriority
Library/SDK docsProjects that expose a library or SDK document their public API surface (e.g. Go doc comments, TypeDoc)P1
CLI documentationProjects with a CLI document commands, flags, and usageP1