Description
openapi.json predates the v2 contract; the README documents /api/v2/streams/* as current with breaking field changes (allowed_actions, created_at, settlement), but the spec does not fully reflect v2, the wallet-auth flow, or the unified error envelope. Bring the OpenAPI 3.1 document in sync with the real route handlers. This is a backend documentation task.
Requirements and Context
- Document
/api/v2/streams (GET/POST) using the toV2Stream shape from app/lib/api-version.ts, including settlement: null semantics.
- Document the wallet challenge/verify flow (
GET/POST /api/auth/wallet) and the bearer-token security scheme.
- Document the shared error envelope and
Deprecation/Sunset headers on v1 paths.
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested Execution
- Fork the repo and create a branch
git checkout -b task/openapi-v2-sync
- Implement changes
openapi.json
- Add a CI/spec-lint or schema test that validates examples against route responses
- Test and commit
npm test -- app/lib/api-version.test.ts
- Cover edge cases: v1 vs v2 field diffs, error envelope schema, auth scheme
- Include test output and notes in the PR
Example commit message
task: sync OpenAPI 3.1 spec with v2 and auth routes
Acceptance Criteria
Guidelines
- Minimum 90% coverage for any spec-validation code added
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
openapi.jsonpredates the v2 contract; the README documents/api/v2/streams/*as current with breaking field changes (allowed_actions,created_at,settlement), but the spec does not fully reflect v2, the wallet-auth flow, or the unified error envelope. Bring the OpenAPI 3.1 document in sync with the real route handlers. This is a backend documentation task.Requirements and Context
/api/v2/streams(GET/POST) using thetoV2Streamshape fromapp/lib/api-version.ts, includingsettlement: nullsemantics.GET/POST /api/auth/wallet) and the bearer-token security scheme.Deprecation/Sunsetheaders on v1 paths.Suggested Execution
openapi.jsonnpm test -- app/lib/api-version.test.tsExample commit message
Acceptance Criteria
/api/v2/streamsdocumented with v2 field shape and examplesGuidelines