Skip to content

[T-084b] OpenAPI 3.1 snapshot (api/openapi.json) + oasdiff breaking-change check + schemathesis nightly #158

Closed

Description

@CodewithJha

Task T-084b · Milestone M7 — API · Size S · Priority P0 · Epic #7

Implements FR-API-001

Branch test/t-084b-openapi-3-1-snapshot-oasdiff — one task = one branch = one PR (doc 32 §6)

Summary

Commit the generated OpenAPI snapshot (scripts/export_openapi.py), add openapi-check CI job (snapshot freshness + oasdiff breaking vs main) and a nightly schemathesis run against a seeded API.

Context / motivation

M7 exit criterion: OpenAPI snapshot committed and schemathesis clean. The web client types are generated from this file (doc 13 §5).

Scope

In scope

  • api/openapi.json, make openapi.
  • .github/workflows/ci.yml job openapi-check; nightly job in e2e.yml or separate api-fuzz.yml.

Implementation guidance

  • scripts/export_openapi.py: imports create_app with test settings and writes api/openapi.json with json.dumps(spec, indent=2, sort_keys=True) plus a trailing newline; make openapi runs it.
  • CI job openapi-check (appended to ci.yml): regenerate and git diff --exit-code api/openapi.json; then oasdiff breaking origin/main:api/openapi.json api/openapi.json --fail-on ERR (oasdiff Docker image pinned by digest).
  • .github/workflows/api-fuzz.yml (nightly + manual): compose core + API with seed_small.sql (T-107), run schemathesis run http://localhost:8000/api/v1/openapi.json --checks all --hypothesis-max-examples=50 --exclude-path-regex '/events' with the token header; upload JUnit + failing cases.
  • The generated web client (T-085c) depends on this file — document the regeneration flow in CONTRIBUTING/AGENTS.md.
  • Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff PLR2004); public APIs typed (mypy strict) and documented.

Acceptance criteria

  • Snapshot drift fails CI; breaking change without /api/v2 fails.
  • Schemathesis: no 5xx / schema violations.
  • Snapshot is deterministic across two exports (byte-identical).
  • Nightly fuzz green, or every finding filed as a bug with its reproducer.
  • Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
  • Docs, config reference and CHANGELOG Unreleased updated where behaviour, keys or interfaces changed.
  • Definition of Done (doc 32 §3) satisfied.

Tests required

  • CI jobs.

Dependencies

Blocked by: #146 (T-081a), #148 (T-081c), #150 (T-081e), #151 (T-082a), #152 (T-082b), #153 (T-082c), #156 (T-083b), #157 (T-084a)

Blocks: #164 (T-085c)

Parallelization notes

Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:

  • api/openapi.json
  • scripts/export_openapi.py
  • .github/workflows/ci.yml (job)
  • .github/workflows/api-fuzz.yml

Final integration of M7.

Definition of Done

Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-084b (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.

References

Design docs: doc 12 §1 · doc 18 §4.9 · doc 20 §1 · doc 16 §7

Requirements: FR-API-001 (traceability: doc 28)

External:

Activity

  1. added this to the M7 — API milestone on Nov 19, 2026
  2. added
    type:testTest suites and test infrastructure
    area:apiREST + SSE API (FastAPI)
    area:ciCI/CD workflows
    priority:P0Critical path / blocks others
    taskChild task of a milestone epic
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiREST + SSE API (FastAPI)area:ciCI/CD workflowsmilestone:M7M7 — APIpriority:P0Critical path / blocks otherssize:S<= 1 daytaskChild task of a milestone epictype:testTest suites and test infrastructure

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions