diff --git a/.github/workflows/check-docs-config.yml b/.github/workflows/check-docs-config.yml new file mode 100644 index 00000000..c844b269 --- /dev/null +++ b/.github/workflows/check-docs-config.yml @@ -0,0 +1,26 @@ +name: Check docs config + +on: + pull_request: + paths: + - 'mintlify/docs.json' + +jobs: + check-openapi-reference: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Ensure docs.json uses production OpenAPI URL + run: | + EXPECTED_URL="https://app.stainless.com/api/spec/documented/grid/openapi.documented.yml" + if grep -q '"openapi.yaml"' mintlify/docs.json; then + echo "::error file=mintlify/docs.json::docs.json references local 'openapi.yaml' instead of the production Stainless URL." + echo "" + echo "The openapi field must point to:" + echo " $EXPECTED_URL" + echo "" + echo "Local openapi.yaml is only for development (make mint handles this automatically)." + exit 1 + fi + echo "docs.json openapi reference looks good." diff --git a/Makefile b/Makefile index 053a41a4..4960eb65 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,14 @@ build: build-openapi: npm run build:openapi +STAINLESS_OPENAPI_URL := https://app.stainless.com/api/spec/documented/grid/openapi.documented.yml +LOCAL_OPENAPI_PATH := openapi.yaml + mint: - cd mintlify && mint dev + @cd mintlify && \ + sed -i.bak 's|$(STAINLESS_OPENAPI_URL)|$(LOCAL_OPENAPI_PATH)|' docs.json && \ + trap 'mv docs.json.bak docs.json' EXIT INT TERM; \ + mint dev lint: npm run lint diff --git a/mintlify/docs.json b/mintlify/docs.json index e407eb19..e5204a21 100644 --- a/mintlify/docs.json +++ b/mintlify/docs.json @@ -268,12 +268,23 @@ }, { "group": "API documentation", - "openapi": "openapi.yaml" + "openapi": "https://app.stainless.com/api/spec/documented/grid/openapi.documented.yml" } ] } ] }, + + "api": { + "playground": { + "display": "interactive" + }, + "examples": { + "languages": ["curl", "javascript", "kotlin"], + "defaults": "all", + "prefill": true + } + }, "logo": { "light": "/logo/light.svg", "dark": "/logo/dark.svg" @@ -307,6 +318,11 @@ "appearance": "dark" }, "seo": {}, + "integrations": { + "gtm": { + "tagId": "GTM-5R5NP3DS" + } + }, "footer": {}, "head": { "raw": "", @@ -347,10 +363,5 @@ "crossOrigin": "anonymous" } ] - }, - "integrations": { - "gtm": { - "tagId": "GTM-5R5NP3DS" - } } }