-
Notifications
You must be signed in to change notification settings - Fork 208
docs: add troubleshooting for api pages #267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
title: 'Troubleshooting' | ||
description: 'Common issues with API References' | ||
icon: 'triangle-exclamation' | ||
--- | ||
|
||
API pages are complicated. As a result, there are a lot of things that can go wrong. | ||
Here's a list of common issues we've seen customers run into: | ||
|
||
<AccordionGroup> | ||
<Accordion title="All of my OpenAPI pages are completely blank"> | ||
In this scenario, it's likely that either Mintlify cannot find your OpenAPI document, | ||
or your OpenAPI document is invalid. | ||
|
||
Running `mintlify dev` locally should reveal some of these issues. | ||
|
||
To verify your OpenAPI document will pass validation: | ||
|
||
1. Visit [this validator](https://apitools.dev/swagger-parser/online/) | ||
2. Switch to the "Validate text" tab | ||
3. Paste in your OpenAPI document | ||
4. Click "Validate it!" | ||
|
||
If the text box that appears below has a green border, your document has passed validation. | ||
This is the exact validation package Mintlify uses to validate OpenAPI documents, so if your document | ||
passes validation here, there's a great chance the problem is elsewhere. | ||
</Accordion> | ||
|
||
<Accordion title="One of my OpenAPI pages is completely blank"> | ||
This is usually caused by a misspelled `openapi` field in the page metadata. Make sure | ||
the HTTP method and path match the HTTP method and path in the OpenAPI document exactly. | ||
If you are specifying a particular OpenAPI file in the `openapi`, ensure the filepath | ||
and file extension are correct. | ||
|
||
Here's an example of how things might go wrong: | ||
```md get-user.mdx | ||
--- | ||
openapi: "GET /users/{id}/" | ||
--- | ||
``` | ||
|
||
```yaml openapi.yaml | ||
paths: | ||
"/users/{id}": | ||
get: | ||
... | ||
``` | ||
|
||
Notice that the path in the `openapi` field has a trailing slash, whereas the path in the OpenAPI | ||
document does not. | ||
</Accordion> | ||
|
||
<Accordion title="Requests from the API Playground don't work"> | ||
This could be an issue with your DNS setup. By default, requests made via the API Playground | ||
mayankshouche marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
start with a `POST` request to the `/api/request` path on the docs site. If your DNS | ||
provider is configured to only allow `GET` requests, then all of these requests will fail. | ||
To fix this, configure your DNS provider to allow `POST` requests to the `/api/request` path. | ||
|
||
Alternatively, if your DNS provider prevents you from accepting `POST` requests, you can configure | ||
Mintlify to send requests directly to your backend with the `api.playground.disableProxy` | ||
setting in the `mint.json`, as described [here](/settings/global#api-configurations). This will | ||
likely require you to configure CORS on your server, as these requests will now come directly | ||
from your users' browsers. | ||
</Accordion> | ||
</AccordionGroup> |
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
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.
Uh oh!
There was an error while loading. Please reload this page.