Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
74976c9
Add API Reference section to docs navigation
beran-t Feb 23, 2026
9e68a7e
Add OpenAPI generation and validation scripts
beran-t Feb 23, 2026
3b1c8f5
Rename envd.py to generate_openapi_reference.py
beran-t Feb 23, 2026
661838e
Refactor generate script to fetch specs from e2b-dev/infra
beran-t Feb 24, 2026
97ab9de
Require sandbox access token auth on all envd endpoints
beran-t Feb 24, 2026
55ebf7a
Fix auth schemes: restore AccessTokenAuth (Bearer), add E2B_ACCESS_TO…
beran-t Feb 24, 2026
4e16293
Add E2B_ACCESS_TOKEN support and improve team ID discovery
beran-t Feb 24, 2026
69b73ad
Fix spec validation findings: 20 critical → 0
beran-t Feb 24, 2026
2a12712
Strip content blocks from 204 responses
beran-t Feb 24, 2026
d93386f
Prefix auth description links with /docs
beran-t Feb 24, 2026
a779849
Add success-path tests for all template write endpoints
beran-t Feb 24, 2026
b8e48e5
Fix 8 spec issues found during SDK testing
beran-t Feb 24, 2026
187b9f2
Fix 12 spec inconsistencies from SDK testing report
beran-t Feb 25, 2026
c633fb4
Fix schema and consistency issues from second SDK testing round
beran-t Feb 25, 2026
08c9bf8
Fix duplicate and misspelled operationIds
beran-t Feb 25, 2026
9e7ac89
Exclude snapshots/volumes endpoints, merge auth tests into Teams phase
beran-t Feb 25, 2026
ccbf03a
Rename and reorder API reference tags for documentation sidebar
beran-t Feb 25, 2026
31adab7
Reorder paths by tag to match desired Mintlify sidebar order
beran-t Feb 25, 2026
98c4972
Tag untagged endpoints (/metrics, /envs) as Others so they appear in …
beran-t Feb 25, 2026
830a859
Add meaningful examples to error responses (400/401/403/404/409/500)
beran-t Feb 25, 2026
6978cf0
Inline /files response definitions so Mintlify renders them correctly
beran-t Feb 25, 2026
b95f1c7
Move error example to Error schema so it applies to all references
beran-t Feb 25, 2026
c497e4f
Add per-status error examples so each error response shows correct co…
beran-t Feb 25, 2026
0538910
Lowercase 'reference' in SDK reference and API reference anchors
beran-t Feb 25, 2026
33f7795
Add short summaries to all platform endpoints for readable Mintlify s…
beran-t Feb 25, 2026
dd3623f
Set format: int64 on Metrics memory/disk fields to prevent overflow
beran-t Feb 26, 2026
4e5d3d7
Replace nullable: true with OpenAPI 3.1.0 type arrays on 14 properties
beran-t Feb 26, 2026
064a0c9
Fix validation script: correct expected statuses, remove internal end…
beran-t Feb 26, 2026
d48d2f2
Hide deprecated badges in sidebar to prevent endpoint name truncation
beran-t Feb 26, 2026
352c960
Add API reference validation workflow (manual trigger only for now)
beran-t Feb 26, 2026
7307ba1
Fix validation script: remove Bearer-only tests, move alias test to p…
beran-t Mar 2, 2026
8b23755
Remove openapi-validation-report.md from repo
beran-t Mar 2, 2026
7bca11f
Hide scrollbar on sidebar API endpoint rows with deprecated badges
beran-t Mar 2, 2026
9ba54ef
edit workflow
beran-t Mar 2, 2026
ba034aa
test true
beran-t Mar 2, 2026
fe02030
works, back to false
beran-t Mar 3, 2026
48ab662
Make workflow run on schedule (disabled for now)
beran-t Mar 3, 2026
44b387e
Merge branch 'main' into add-api-ref-to-nav
beran-t Mar 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions .github/workflows/api-reference-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
name: API Reference Validation

on:
# schedule:
# # Every Thursday at 8 PM UTC
# - cron: '0 20 * * 4'
workflow_dispatch:

concurrency:
group: api-reference-validation
cancel-in-progress: false

jobs:
validate:
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: pip install pyyaml

# Step 1: Generate spec from source
- name: Generate OpenAPI spec
run: python3 scripts/generate_openapi_reference.py --output openapi-generated.yml

# Step 2: Compare with committed spec
- name: Compare specs
id: diff
run: |
if diff -q openapi-public.yml openapi-generated.yml > /dev/null 2>&1; then
echo "Spec is up to date — nothing to do"
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "Spec has drifted from source"
echo "changed=true" >> $GITHUB_OUTPUT
fi

# Step 3: If no difference, exit early
# (all subsequent steps are gated on changed == 'true')

# Step 4: Run validation against the NEW generated spec
- name: Run validation
if: steps.diff.outputs.changed == 'true'
id: validate
continue-on-error: true
env:
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
E2B_ACCESS_TOKEN: ${{ secrets.E2B_ACCESS_TOKEN }}
run: |
# Replace committed spec with generated one before validating
cp openapi-generated.yml openapi-public.yml

# Capture the full output; the script exits 1 on critical findings
python3 scripts/validate_api_reference.py \
--output openapi-validation-report.md \
--verbose 2>&1 | tee validation-output.txt

# Extract the final summary block (everything after the last ===... line)
SUMMARY=$(awk '/^={50,}/{buf=""} {buf=buf"\n"$0} END{print buf}' validation-output.txt)
# Store for PR body (escape newlines for GitHub output)
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "summary<<$EOF" >> $GITHUB_OUTPUT
echo "$SUMMARY" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT

# Step 5+6: Create PR with status indicator
- name: Create PR
if: steps.diff.outputs.changed == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATION_OUTCOME: ${{ steps.validate.outcome }}
VALIDATION_SUMMARY: ${{ steps.validate.outputs.summary }}
run: |
if [ "$VALIDATION_OUTCOME" = "success" ]; then
STATUS_ICON="🟢"
STATUS_TEXT="Validation passed"
else
STATUS_ICON="🔴"
STATUS_TEXT="Validation failed — critical findings detected"
fi

BRANCH="api-spec-update-$(date +%Y-%m-%d)"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

git checkout -b "$BRANCH"
git add openapi-public.yml
git commit -m "docs: update openapi-public.yml from source specs $(date +%Y-%m-%d)"
git push -u origin "$BRANCH"

gh pr create \
--title "$STATUS_ICON Update API spec $(date +%Y-%m-%d)" \
--body "$(cat <<EOF
## OpenAPI Spec Update

The generated \`openapi-public.yml\` has drifted from the source specs.
This PR updates it to match the latest upstream definitions.

### Validation: $STATUS_ICON $STATUS_TEXT

\`\`\`
$VALIDATION_SUMMARY
\`\`\`
EOF
)" \
--base main

- name: Summary
if: always()
env:
CHANGED: ${{ steps.diff.outputs.changed }}
VALIDATION_OUTCOME: ${{ steps.validate.outcome }}
run: |
echo "## API Reference Spec Check" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Result | Value |" >> $GITHUB_STEP_SUMMARY
echo "|--------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| Spec changed | ${CHANGED:-false} |" >> $GITHUB_STEP_SUMMARY
echo "| Validation | ${VALIDATION_OUTCOME:-skipped} |" >> $GITHUB_STEP_SUMMARY
8 changes: 8 additions & 0 deletions docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,14 @@
"anchor": "SDK reference",
"icon": "brackets-curly",
"href": "https://e2b.dev/docs/sdk-reference"
},
{
"anchor": "API reference",
"icon": "code",
"openapi": {
"source": "openapi-public.yml",
"directory": "docs/api-reference"
}
}
],
"global": {}
Expand Down
Loading