Skip to content

feat: adding sdk examples to api reference and enabling the playground#313

Merged
pengying merged 1 commit intomainfrom
03-31-feat_adding_sdk_examples_to_api_reference_and_enabling_the_playground
Apr 1, 2026
Merged

feat: adding sdk examples to api reference and enabling the playground#313
pengying merged 1 commit intomainfrom
03-31-feat_adding_sdk_examples_to_api_reference_and_enabling_the_playground

Conversation

@pengying
Copy link
Copy Markdown
Contributor

@pengying pengying commented Apr 1, 2026

No description provided.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
grid-flow-builder Ready Ready Preview, Comment Apr 1, 2026 3:33am

Request Review

@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 1, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
Grid 🟢 Ready View Preview Apr 1, 2026, 3:34 AM

Copy link
Copy Markdown
Contributor Author

pengying commented Apr 1, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 1, 2026

Greptile Summary

This PR enables the interactive API playground and SDK code examples (curl, JavaScript, Kotlin) in the Mintlify API reference, while also migrating docs.json to reference the production Stainless OpenAPI URL instead of the local openapi.yaml.

To support this split between production (docs.json → remote URL) and local development (make mint → local file), the PR introduces:

  • A sed-based swap in the Makefile that temporarily replaces the production URL with openapi.yaml when running mint dev, restoring the original on exit via a trap.
  • A new CI workflow (.github/workflows/check-docs-config.yml) that fails any PR where docs.json still contains the local \"openapi.yaml\" reference, acting as a safety net for the occasional case where the trap cannot fire (e.g. SIGKILL).

Changes:

  • mintlify/docs.json: Switches openapi field to the production Stainless URL, adds \"api\" block configuring the interactive playground and multi-language examples, and relocates the \"integrations\" block earlier in the file (no functional change to integrations).
  • Makefile: Extends make mint with the URL-swap/restore pattern for local development.
  • .github/workflows/check-docs-config.yml: New guard workflow preventing accidental commits of the local OpenAPI path.

Minor issue found:

  • The newly added \"api\" block in docs.json has inconsistent indentation (1-space/3-space) compared to the 2-space convention used throughout the rest of the file.

Confidence Score: 5/5

Safe to merge — no functional bugs; the only finding is a minor indentation inconsistency in docs.json.

All three files are well-implemented. The Makefile trap pattern is correct and cross-platform, and the CI guard provides an effective backstop. The single P2 comment is a cosmetic indentation issue that does not affect functionality or JSON parsing.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/check-docs-config.yml New CI workflow that guards against accidentally committing the local openapi.yaml path into docs.json; straightforward grep check, correct path and trigger configuration.
Makefile Adds a sed-based swap of the production OpenAPI URL to the local path for make mint, with a trap to restore docs.json on exit/interrupt — cross-platform and logically correct.
mintlify/docs.json Switches OpenAPI source to the production Stainless URL, adds API playground and SDK examples config, and moves the integrations block — minor indentation inconsistency in the new "api" block.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Developer runs `make mint`] --> B[sed swaps production URL to openapi.yaml in docs.json]
    B --> C[trap registered for EXIT / INT / TERM]
    C --> D[mint dev runs with local OpenAPI]
    D --> E{Process exits?}
    E -- Normal / Ctrl-C / TERM --> F[trap fires: docs.json.bak restored]
    F --> G[docs.json back to production URL]
    E -- SIGKILL --> H[docs.json left with local path]
    H --> I[CI workflow blocks accidental commit]
    J[PR touches docs.json] --> K[check-docs-config.yml workflow runs]
    K --> L{Contains openapi.yaml?}
    L -- Yes --> M[CI fails]
    L -- No --> N[CI passes]
Loading
Prompt To Fix All With AI
This is a comment left during a code review.
Path: mintlify/docs.json
Line: 278-287

Comment:
**Inconsistent indentation in `"api"` block**

The new `"api"` block uses 1-space indentation for the top-level key and 3-space indentation for its children, while the rest of `docs.json` uses a consistent 2-space indentation (e.g., `"logo"`, `"navbar"`, `"integrations"` at line 288+). The closing `},` is at 2 spaces which is correct, but the opening key and nested keys are misaligned.

```suggestion
  "api": {
    "playground": {
      "display": "interactive"
    },
    "examples": {
      "languages": ["curl", "javascript", "kotlin"],
      "defaults": "all",
      "prefill": true
    }
  },
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat: adding sdk examples to api referen..." | Re-trigger Greptile

Comment on lines +278 to +287
"api": {
"playground": {
"display": "interactive"
},
"examples": {
"languages": ["curl", "javascript", "kotlin"],
"defaults": "all",
"prefill": true
}
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Inconsistent indentation in "api" block

The new "api" block uses 1-space indentation for the top-level key and 3-space indentation for its children, while the rest of docs.json uses a consistent 2-space indentation (e.g., "logo", "navbar", "integrations" at line 288+). The closing }, is at 2 spaces which is correct, but the opening key and nested keys are misaligned.

Suggested change
"api": {
"playground": {
"display": "interactive"
},
"examples": {
"languages": ["curl", "javascript", "kotlin"],
"defaults": "all",
"prefill": true
}
},
"api": {
"playground": {
"display": "interactive"
},
"examples": {
"languages": ["curl", "javascript", "kotlin"],
"defaults": "all",
"prefill": true
}
},
Prompt To Fix With AI
This is a comment left during a code review.
Path: mintlify/docs.json
Line: 278-287

Comment:
**Inconsistent indentation in `"api"` block**

The new `"api"` block uses 1-space indentation for the top-level key and 3-space indentation for its children, while the rest of `docs.json` uses a consistent 2-space indentation (e.g., `"logo"`, `"navbar"`, `"integrations"` at line 288+). The closing `},` is at 2 spaces which is correct, but the opening key and nested keys are misaligned.

```suggestion
  "api": {
    "playground": {
      "display": "interactive"
    },
    "examples": {
      "languages": ["curl", "javascript", "kotlin"],
      "defaults": "all",
      "prefill": true
    }
  },
```

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@pengying pengying merged commit bbcff53 into main Apr 1, 2026
12 checks passed
@pengying pengying deleted the 03-31-feat_adding_sdk_examples_to_api_reference_and_enabling_the_playground branch April 1, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants