@devries-cameron20 / composio Mirror · read-only / commits / 914bccf35
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 19:45 UTC

docs: fix API reference curl base URL (staging → production) (#3761)

# Description The curl examples in the API reference docs pointed at **staging** instead of production. Reported (Slack): *"Curl in API reference docs points to staging-apollo instead of backend.composio.dev."* **Root cause:** the API reference (fumadocs, `docs/lib/openapi.ts`) renders curl snippets using `servers[0].url` from the committed specs `docs/public/openapi.json` (v3.1) and `docs/public/openapi-v3.json` (v3.0). Both had: ```json "servers": [{ "url": "http://staging-apollo.composio.dev", "description": "STAGING API" }] ``` This is a **recurring** regression, not a one-off stale file. The scheduled workflow **`.github/workflows/docs-update-data.yml`** (`cron: '0 */5 * * *'`, plus on Apollo production deploys) deliberately points `OPENAPI_SPEC_URL` at **staging** (`COMPOSIO_BASE_URL_STAGING`, with a guard that *fails* if it's production), runs `bun run scripts/fetch-openapi.mjs`, and auto-commits the regenerated specs via PR. Staging's spec serves `servers[0].url = http://staging-apollo.composio.dev` (verified: `GET https://staging-backend.composio.dev/api/v3{,.1}/openapi.json`), and `fetch-openapi.mjs` did not override `servers` — so every ~5h the staging server URL got re-committed (the most recent spec commit `a3e58a421 docs: update ... API spec ...` came from exactly this workflow). The live production backend and the platform-committed apollo spec both correctly serve `https://backend.composio.dev / PRODUCTION API`. **Changes:** - `docs/public/openapi.json` + `docs/public/openapi-v3.json`: set `servers[0]` to `https://backend.composio.dev` / `PRODUCTION API`. - `docs/scripts/fetch-openapi.mjs`: pin `spec.servers` to the production URL in `postProcessSpec`. This is the **durable** fix — because the update-data workflow fetches from staging, a JSON-only edit would be reverted within ~5h; pinning in the generator forces the published curl base URL to production regardless of which environment the source spec was fetched from. # How did I test this PR - **Verified the servers value** in both committed specs (valid JSON): - `node -e "require('./public/openapi.json').servers"` → `[{"url":"https://backend.composio.dev","description":"PRODUCTION API"}]` - same for `public/openapi-v3.json` - **Zero residual** `staging-apollo` references under `docs/public`, `docs/scripts`, `docs/lib`. - **Confirmed the recurrence mechanism:** read `docs-update-data.yml` (staging fetch + auto-PR) and confirmed `staging-backend.composio.dev/api/v3{,.1}/openapi.json` returns `http://staging-apollo.composio.dev`, while live prod + `apps/apollo/openapi.json` return `https://backend.composio.dev`. The `postProcessSpec` pin overrides this in the generator. - **Generator:** `node --check docs/scripts/fetch-openapi.mjs` → syntax OK. - **Docs static tests** (the "Docs - Tests" CI check): `bun test tests/static/` → 16 pass, 0 fail. - **CI on this commit:** Docs - Tests ✓, Docs - TypeScript Code Validation ✓, Docs - Check Links ✓, Secrets Detection ✓, Vercel preview ✓. - **Codex review:** no correctness issues found. # Security - **Trivy** (`fs --scanners vuln,secret --severity CRITICAL,HIGH,MEDIUM --ignore-unfixed`) on all three changed files → clean (no vulnerabilities, no secrets). - **Socket** (dependency/supply-chain): N/A — no dependency or lockfile changes. - Note: `security/snyk (Composio)` shows failing, but it's a **pre-existing repo-wide failure** (errors identically on PRs #3756–#3761; this change touches no dependencies). Triggered by: palash@composio.dev | Source: slack Session: https://zen.corp.composio.io/dashboard/#/chat/zen-e559fb27fb16 Co-authored-by: Zen Agent <zen@composio.dev> Co-authored-by: palash <palash@composio.dev>

composio-zen[bot] committed Jul 7, 2026 at 16:28 UTC 914bccf3559bd91b3332d41906784a6c2c2e1bf6
3 files changed +15 -4
docs/public/openapi-v3.json
+2 -2
@@ -16,8 +16,8 @@
16 },
17 "servers": [
18 {
19 - "url": "http://staging-apollo.composio.dev",
20 - "description": "STAGING API"
19 + "url": "https://backend.composio.dev",
20 + "description": "PRODUCTION API"
21 }
22 ],
23 "tags": [
docs/public/openapi.json
+2 -2
@@ -16,8 +16,8 @@
16 },
17 "servers": [
18 {
19 - "url": "http://staging-apollo.composio.dev",
20 - "description": "STAGING API"
19 + "url": "https://backend.composio.dev",
20 + "description": "PRODUCTION API"
21 }
22 ],
23 "tags": [
docs/scripts/fetch-openapi.mjs
+11
@@ -89,6 +89,17 @@ function cleanOperationIds(paths) {
89 * Post-process a spec: remove CookieAuth, normalize unions, fix nullable.
90 */
91 function postProcessSpec(spec) {
92 + // Pin the server to production. The published docs must always show the
93 + // production base URL in their curl examples, regardless of which environment
94 + // the source spec was fetched from (a staging fetch would otherwise bake a
95 + // staging server URL into the committed reference).
96 + spec.servers = [
97 + {
98 + url: 'https://backend.composio.dev',
99 + description: 'PRODUCTION API',
100 + },
101 + ];
102 +
103 // Filter tags list
104 if (spec.tags) {
105 spec.tags = spec.tags.filter(tag => !IGNORED_TAGS.includes(tag.name));