Skip to content

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

feat: update API docs generation process (#1983)

Himanshu Dixit5bbbd19174bd
diff --git a/.gitignore b/.gitignore
index 86b226e54..44725b7ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -47,6 +47,7 @@ fern/toolkits/*
!fern/tools/src/
!fern/tools/src/**
fern/apis/openapi.yml
+fern/apis/openapi.json
fern/apis/openapi-mcp.json
fern/pages/dist/
fern/pages/sdk/
diff --git a/README.md b/README.md
index 270714ead..eb093e003 100644
--- a/README.md
+++ b/README.md
@@ -66,6 +66,19 @@ composio = Composio(
For more detailed usage instructions and examples, please refer to each SDK's specific documentation.
+### Open API Specification
+
+To update the OpenAPI specifications used for generating SDK documentation:
+
+```bash
+# Pull the latest API specifications from the backend
+pnpm api:pull
+```
+
+This command pulls the OpenAPI specification from `https://backend.composio.dev/api/v3/openapi.json` (defined in `fern/scripts/pull-openapi-spec.sh`) and updates the local API documentation files.
+
+This is pulled automatically with build step.
+
## Available SDKs
### TypeScript SDK (/ts)
diff --git a/fern/apis/openapi-overrides.yml b/fern/apis/openapi-overrides.yml
index 7ed4e30a1..8c53cc5ae 100644
--- a/fern/apis/openapi-overrides.yml
+++ b/fern/apis/openapi-overrides.yml
@@ -2,6 +2,15 @@ paths:
/api/v3/mcp/validate/{uuid}:
get:
x-fern-ignore: true
+ /api/v3/cli/get-session:
+ get:
+ x-fern-ignore: true
+ /api/v3/cli/create-session:
+ post:
+ x-fern-ignore: true
+ /api/v3/auth/session/logout:
+ post:
+ x-fern-ignore: true
components:
securitySchemes:
ApiKeyAuth:
diff --git a/fern/apis/v3/generators.yml b/fern/apis/v3/generators.yml
index ced67b1b5..415ed5e9e 100644
--- a/fern/apis/v3/generators.yml
+++ b/fern/apis/v3/generators.yml
@@ -1,6 +1,6 @@
api:
specs:
- - openapi: ../openapi.yml
+ - openapi: ../openapi.json
overrides: ../openapi-overrides.yml
settings:
title-as-schema-name: false
diff --git a/fern/scripts/pull-openapi-spec.sh b/fern/scripts/pull-openapi-spec.sh
index 2848b09e8..3b482e94e 100755
--- a/fern/scripts/pull-openapi-spec.sh
+++ b/fern/scripts/pull-openapi-spec.sh
@@ -3,16 +3,14 @@
# Exit on any error
set -e
-# Define the OpenAPI specification URL and paths
-# OPENAPI_URL="https://hermes.composio.dev/openapi.json"
-OPENAPI_URL="https://app.stainless.com/api/spec/documented/composio-sdk/openapi.documented.yml"
+OPENAPI_URL="https://backend.composio.dev/api/v3/openapi.json"
OPENAPI_MCP_URL="https://mcp.composio.dev/openapi.json"
# Get the directory where the script is located, works in both CI and local environments
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" 2>/dev/null || dirname "$0")" && pwd)"
FERN_DIR="$(dirname "$SCRIPT_DIR")"
API_DIR="$FERN_DIR/apis"
-OUTPUT_FILE="$API_DIR/openapi.yml"
+OUTPUT_FILE="$API_DIR/openapi.json"
# OUTPUT_V3_FILE="$API_DIR/openapi-v3.json"
OUTPUT_MCP_FILE="$API_DIR/openapi-mcp.json"
diff --git a/fern/turbo.json b/fern/turbo.json
index ab7aea1a1..b7af4dfeb 100644
--- a/fern/turbo.json
+++ b/fern/turbo.json
@@ -4,7 +4,7 @@
"tasks": {
"build": {
"dependsOn": ["api:pull", "add-og", "snippets:build", "tools:generate", "sdkdocs"],
- "outputs": ["apis/openapi.yml", "apis/openapi-mcp.json", "pages/dist/**", "tools/**"],
+ "outputs": ["apis/openapi.json", "apis/openapi-mcp.json", "pages/dist/**", "tools/**"],
"cache": true
},
@@ -26,7 +26,7 @@
},
"api:pull": {
- "outputs": ["apis/openapi.yml", "apis/openapi-mcp.json"],
+ "outputs": ["apis/openapi.json", "apis/openapi-mcp.json"],
"cache": true
},