fix: correct API reference server URL so request examples render#804
Merged
Conversation
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the OpenAPI servers configuration across the API reference specs so Mintlify can render request examples using a valid base URL on first paint, avoiding the transient “A valid request URL is required…” error and the permanently blank example on the “Send Chat Message” endpoint.
Changes:
- Replaced templated
servers[0].urlvalues (e.g.,{api_base_url},{apiBaseUrl}) with the absolute URLhttps://api.dify.ai/v1. - Removed
servers[0].variablesblocks that previously carried the real URL viadefault. - Added/updated localized
servers[0].descriptiontext to instruct self-hosted users to replace the base URL (EN/ZH/JA).
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| zh/api-reference/openapi_workflow.json | Set absolute servers[0].url and updated server description (ZH). |
| zh/api-reference/openapi_knowledge.json | Set absolute servers[0].url and updated server description (ZH). |
| zh/api-reference/openapi_completion.json | Set absolute servers[0].url and updated server description (ZH). |
| zh/api-reference/openapi_chatflow.json | Set absolute servers[0].url and updated server description (ZH). |
| zh/api-reference/openapi_chat.json | Set absolute servers[0].url and updated server description (ZH). |
| ja/api-reference/openapi_workflow.json | Set absolute servers[0].url and updated server description (JA). |
| ja/api-reference/openapi_knowledge.json | Set absolute servers[0].url and updated server description (JA). |
| ja/api-reference/openapi_completion.json | Set absolute servers[0].url and updated server description (JA). |
| ja/api-reference/openapi_chatflow.json | Set absolute servers[0].url and updated server description (JA). |
| ja/api-reference/openapi_chat.json | Set absolute servers[0].url and updated server description (JA). |
| en/api-reference/openapi_workflow.json | Set absolute servers[0].url and updated server description (EN). |
| en/api-reference/openapi_knowledge.json | Set absolute servers[0].url and updated server description (EN). |
| en/api-reference/openapi_completion.json | Set absolute servers[0].url and updated server description (EN). |
| en/api-reference/openapi_chatflow.json | Set absolute servers[0].url and updated server description (EN). |
| en/api-reference/openapi_chat.json | Set absolute servers[0].url and updated server description (EN). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
5bd2fa7 to
c2ad662
Compare
This was referenced Jun 1, 2026
Contributor
Author
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
RiskeyL
added a commit
that referenced
this pull request
Jun 1, 2026
RiskeyL
added a commit
that referenced
this pull request
Jun 1, 2026
RiskeyL
added a commit
that referenced
this pull request
Jun 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every API reference page briefly showed "A valid request URL is required to generate request examples" on load, and the Send Chat Message page (the only endpoint with multiple request examples) rendered a blank request example that never recovered.
The cause was the
servers[0].urlin all OpenAPI specs: a bare{api_base_url}token with no URL scheme. Mintlify can't parse a schemeless template as an absolute URL on first paint, so it failed to build the request example. Interacting with a control forced a re-render that resolved the variable default, which is why selecting from the dropdown cleared the error.Fix
Prefix the literal
https://scheme onto the templated URL (https://{api_base_url}) and move the host and path into the variable default (api.dify.ai/v1). The template now parses as a valid URL on first paint, eliminating the error and the blank example, while keeping a server variable so the playground retains its editable Server (base URL) field for self-hosted users. The scheme is fixed tohttps, which is correct for browser-origin "Try it" requests anyway. zh and ja specs are updated in step, with the variable description translated.