Skip to main content

OpenAPI and playground

Canonical spec, copy in docs, and how the interactive reference is generated.
1 min read

Canonical spec (product monorepo)#

  • OpenAPI 3.0.3
  • Base paths under /api
  • Tags by domain (Users, Tasks, Finance, …)
  • Security schemes: session bearer (+ cron bearer on internal routes)

Copy on the docs site#

Docs7 only packages the apps/docs directory. That is why there is a copy:

The sidebar includes the OpenAPI Reference group, generated automatically from that file (pages per operation + playground).

How to keep them in sync#

When you change routes or schemas in Go:

  1. Update apps/api/docs/openapi.yaml (backend source of truth).
  2. Copy to docs:
  1. Commit both files in the same PR.
  2. Merge to main → Docs7 redeploy.
Tip

Ideally a CI script docs:sync-openapi does the cp and fails if they differ. It can be added later.

Playground#

  • Spec servers: http://localhost:{port}/api and a configurable server.
  • Do not use production secrets in public demos.

Partial specs#

FileUse
apps/api/openapi/finance.v1.yamlVersioned finance / experiments

You can link additional specs in docs.json when they are mature.

Validate locally#

Download#

If the page menu exposes a spec download, use that. The YAML also lives at /openapi/agata-v1.yaml on the docs host (Docs7). Until that host serves the file, the published mirror copy is https://raw.githubusercontent.com/fanivi-dev/agata-docs/main/openapi/agata-v1.yaml (byte-matched with apps/docs/openapi/agata-v1.yaml).