Skip to content

Commit 9f68f53

Browse files
authored
feat: [docs] add v3 api refs alongwith updated MCP API refs (#1529)
1 parent 7d32908 commit 9f68f53

File tree

8 files changed

+140
-52
lines changed

8 files changed

+140
-52
lines changed

.github/workflows/preview_docs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,11 @@ jobs:
5050
- name: Install Fern
5151
run: npm install -g fern-api
5252

53+
- name: Install jq
54+
run: sudo apt-get update && sudo apt-get install -y jq
55+
5356
- name: Pull Latest OpenAPI Specification
54-
run: sh scripts/pull-openapi-spec.sh
57+
run: bash scripts/pull-openapi-spec.sh
5558

5659
- name: Generate preview URL
5760
id: generate-docs

.github/workflows/publish_docs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@ jobs:
4949
- name: Install Fern
5050
run: npm install -g fern-api
5151

52+
- name: Install jq
53+
run: sudo apt-get update && sudo apt-get install -y jq
54+
5255
- name: Pull Latest OpenAPI Specification
53-
run: sh scripts/pull-openapi-spec.sh
56+
run: bash scripts/pull-openapi-spec.sh
5457

5558
- name: Publish Docs
5659
env:

.gitignore

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,82 @@
1+
# Environment files
12
.env
3+
4+
# Jupyter notebooks
25
try.ipynb
6+
refactor_debug.ipynb
7+
8+
# Python cache and compiled files
9+
**/__pycache__
10+
*.pyc
311
*pycache*
4-
user_data.json
12+
**/*.egg-info
13+
*egg-info*
14+
.mypy_cache/
15+
.ruff_cache
16+
.tox/
17+
18+
# Virtual environments
519
.venv
620
venv*
21+
22+
# Distribution and build directories
723
**/dist
8-
.DS_Store
9-
*egg-info*
10-
**/composio_autogen.egg-info
11-
**/composio_llamaindex.egg-info
12-
**/__pycache__
13-
**/*.egg-info
14-
*.pyc
15-
.tox/
16-
.mypy_cache/
24+
build
25+
core/build/lib/*
26+
temp
27+
28+
# Logs and caches
29+
**/coder_agent_logs_*
30+
**/.composio.coder.*
31+
.indexing_status.json
32+
.python/swe/logs
33+
python/swe/tests/logs_dir
34+
python/swe/dockerfiles/logs*
1735

36+
# Coverage and test results
1837
.coverage
1938
coverage.xml
2039
junit.xml
40+
.pytest_cache
41+
.test_results
2142

22-
core/build/lib/*
23-
43+
# Node modules and other dependencies
2444
node_modules
45+
Pipfile.lock
46+
47+
# System files
48+
.DS_Store
2549
~
2650

27-
Pipfile.lock
28-
build
29-
temp
51+
# Specific project directories and files
52+
**/composio_autogen.egg-info
53+
**/composio_llamaindex.egg-info
3054
.cache
31-
.pytest_cache
32-
.test_results
3355
.trunk
34-
refactor_debug.ipynb
35-
**/coder_agent_logs_*
36-
**/.composio.coder.*
37-
.indexing_status.json
38-
39-
.ruff_cache
4056

57+
# Dockerfiles and related directories
4158
python/dockerfiles/e2b-dev/composio
4259
python/dockerfiles/composio
4360
python/swe/dockerfiles/generated
44-
python/swe/dockerfiles/logs*
45-
python/swe/logs
46-
python/swe/tests/logs_dir
4761
python/swe/dockerfiles/indexed
4862
python/swe/agentic
4963
python/swe/dockerfiles/generated*
5064

65+
# Fern SDK and tools
5166
fern/sdk/composio/
5267
fern/tools/*
5368
!fern/tools/introduction.mdx
5469
fern/code
70+
fern/api/openapi.json
71+
fern/api/openapi-v3.json
5572

73+
# Cursor and GitHub styles
5674
.cursor/*
57-
5875
.github/styles/*
59-
# !.github/styles/config/
60-
6176
.github/styles/config/*
62-
# !.github/styles/config/vocabularies/
63-
6477
.github/styles/config/vocabularies/*
65-
# !.github/styles/config/vocabularies/Base
66-
6778

79+
# Styles
6880
styles/*
69-
# !styles/config/
70-
7181
styles/config/*
72-
# !styles/config/vocabularies/
73-
7482
styles/config/vocabularies/*
75-
# !styles/config/vocabularies/Composio

fern/api/openapi-v3-overrides.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
paths:
2+
# Hide the MCP server validation endpoint
3+
/api/v1/mcp/servers/validate/uuid:
4+
x-hidden: true # This will hide this endpoint completely

fern/generators.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
api:
2-
path: ./openapi.json
3-
overrides: ./openapi-overrides.yml
4-
settings:
5-
use-title: false
1+
api:
2+
namespaces:
3+
v1:
4+
path: ./api/openapi.json
5+
overrides: ./api/openapi-overrides.yml
6+
settings:
7+
use-title: false
8+
v3:
9+
path: ./api/openapi-v3.json
10+
overrides: ./api/openapi-v3-overrides.yml
11+
settings:
12+
use-title: false

fern/openapi.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

fern/scripts/pull-openapi-spec.sh

Lines changed: 71 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,89 @@ set -e
55

66
# Define the OpenAPI specification URL and paths
77
OPENAPI_URL="https://backend.composio.dev/openapi.json"
8-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
8+
OPENAPI_V3_URL="https://qa-apollo.composio.dev/api/v3/openapi.json"
9+
10+
# Get the directory where the script is located, works in both CI and local environments
11+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" 2>/dev/null || dirname "$0")" && pwd)"
912
FERN_DIR="$(dirname "$SCRIPT_DIR")"
10-
OUTPUT_FILE="$FERN_DIR/openapi.json"
13+
API_DIR="$FERN_DIR/api"
14+
TEMP_FILE="/tmp/openapi-temp.json"
15+
TEMP_V3_FILE="/tmp/openapi-v3-temp.json"
16+
OUTPUT_FILE="$API_DIR/openapi.json"
17+
OUTPUT_V3_FILE="$API_DIR/openapi-v3.json"
18+
19+
# Debug information
20+
echo "Script directory: $SCRIPT_DIR"
21+
echo "Fern directory: $FERN_DIR"
22+
echo "API directory: $API_DIR"
23+
24+
# Create API directory if it doesn't exist
25+
mkdir -p "$API_DIR"
1126

1227
echo "Pulling latest OpenAPI specification from $OPENAPI_URL"
1328

1429
# Use curl to fetch the OpenAPI specification
15-
if curl -f -o "$OUTPUT_FILE" "$OPENAPI_URL"; then
16-
echo "Successfully downloaded OpenAPI specification to $OUTPUT_FILE"
30+
if curl -f -o "$TEMP_FILE" "$OPENAPI_URL"; then
31+
echo "Successfully downloaded OpenAPI specification to temporary file"
1732
else
1833
echo "Failed to download OpenAPI specification"
1934
exit 1
2035
fi
2136

2237
# Validate that the file exists and is not empty
23-
if [ -s "$OUTPUT_FILE" ]; then
38+
if [ -s "$TEMP_FILE" ]; then
2439
echo "Verified OpenAPI specification file exists and is not empty"
2540
else
2641
echo "Error: OpenAPI specification file is empty or does not exist"
2742
exit 1
28-
fi
43+
fi
44+
45+
# Filter out specific paths using jq
46+
echo "Filtering out specified paths from OpenAPI specification"
47+
if command -v jq &> /dev/null; then
48+
# Remove the path - try both formats since it could be either
49+
jq 'del(.paths."/api/v1/mcp/servers/validate/uuid") | del(.paths."/api/v1/mcp/servers/validate/{uuid}")' "$TEMP_FILE" > "$OUTPUT_FILE"
50+
echo "Successfully filtered OpenAPI specification and saved to $OUTPUT_FILE"
51+
else
52+
echo "Warning: jq is not installed. Cannot filter paths."
53+
echo "Please install jq with: brew install jq"
54+
# Copy unfiltered file as fallback
55+
cp "$TEMP_FILE" "$OUTPUT_FILE"
56+
fi
57+
58+
# Fetch the OpenAPI v3 specification
59+
echo "Pulling latest OpenAPI v3 specification from $OPENAPI_V3_URL"
60+
if curl -f -o "$TEMP_V3_FILE" "$OPENAPI_V3_URL"; then
61+
echo "Successfully downloaded OpenAPI v3 specification to temporary file"
62+
else
63+
echo "Failed to download OpenAPI v3 specification"
64+
exit 1
65+
fi
66+
67+
# Validate that the v3 file exists and is not empty
68+
if [ -s "$TEMP_V3_FILE" ]; then
69+
echo "Verified OpenAPI v3 specification file exists and is not empty"
70+
else
71+
echo "Error: OpenAPI v3 specification file is empty or does not exist"
72+
exit 1
73+
fi
74+
75+
# Filter the v3 spec using jq
76+
if command -v jq &> /dev/null; then
77+
# Remove the path - try both formats since it could be either
78+
jq 'del(.paths."/api/v1/mcp/servers/validate/uuid") | del(.paths."/api/v1/mcp/servers/validate/{uuid}")' "$TEMP_V3_FILE" > "$OUTPUT_V3_FILE"
79+
echo "Successfully filtered OpenAPI v3 specification and saved to $OUTPUT_V3_FILE"
80+
else
81+
# Copy unfiltered file as fallback
82+
cp "$TEMP_V3_FILE" "$OUTPUT_V3_FILE"
83+
fi
84+
85+
# For debugging
86+
ls -la "$API_DIR"
87+
echo "FERN_DIR=$FERN_DIR"
88+
echo "API_DIR=$API_DIR"
89+
90+
# Clean up temporary files
91+
rm "$TEMP_FILE" "$TEMP_V3_FILE"
92+
93+
echo "OpenAPI specifications successfully updated"

0 commit comments

Comments
 (0)