Convert from swagger to API docs.
Renamed swagger_api/openapi.yaml to api/openapi.yaml and updated references in docs/api.md. Removed swagger add to requirements.txt
This commit is contained in:
21
docs/api.md
21
docs/api.md
@@ -6,9 +6,9 @@ This page contains the interactive API documentation for ntfy. You can try out t
|
||||
|
||||
### Server Selection
|
||||
|
||||
The Swagger UI includes a server selector dropdown at the top of the page. By default, it's configured to use the **public ntfy.sh server**.
|
||||
The API reference includes a server selector dropdown at the top of the page. By default, it's configured to use the **public ntfy.sh server**.
|
||||
|
||||
To use your own ntfy instance, edit `docs/swagger_api/openapi.yaml` and add your server URL to the `servers` section:
|
||||
To use your own ntfy instance, edit `docs/api/openapi.yaml` and add your server URL to the `servers` section:
|
||||
|
||||
```yaml
|
||||
servers:
|
||||
@@ -22,10 +22,23 @@ After editing the file, rebuild the docs with `mkdocs build`.
|
||||
|
||||
### Authentication
|
||||
|
||||
Click the **Authorize** button (lock icon) in Swagger UI to add your access token. Use the format `Bearer <your_token>` or `Basic <base64_encoded_credentials>`.
|
||||
Click the **Authorize** button (lock icon) in the API reference to add your access token. Use the format `Bearer <your_token>` or `Basic <base64_encoded_credentials>`.
|
||||
|
||||
### Try It Out
|
||||
|
||||
Click **Try it out** on any endpoint to test it directly. Parameters will be empty by default - enter your own values to test.
|
||||
|
||||
<swagger-ui src="swagger_api/openapi.yaml"/>
|
||||
---
|
||||
|
||||
<script>
|
||||
// Redirect to standalone Scalar page - use absolute path from root
|
||||
var currentPath = window.location.pathname;
|
||||
// Get base path (everything before /api/)
|
||||
var basePath = currentPath.substring(0, currentPath.indexOf('/api/'));
|
||||
if (basePath === -1 || basePath === '') {
|
||||
basePath = '';
|
||||
}
|
||||
window.location.href = basePath + '/api/scalar.html';
|
||||
</script>
|
||||
|
||||
If you are not redirected automatically, [click here to view the API Reference](api/scalar.html).
|
||||
Reference in New Issue
Block a user