Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/
npm-debug.log*
.env
.env.local
.playwright-cli/
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ The canonical spec is **`openapi.yaml`** at the repo root. A pre-bundled single-
| `openapi.yaml` | Canonical merged spec for the full Wokelo API |
| `sources/` | 26 standalone capability specs, one per official docs page |
| `dist/wokelo-openapi.yaml` | Bundled spec for import into external tools and directories |
| `dist/index.html` | Static Redoc HTML docs |
| `dist/index.html` | Public Redoc reference docs (client-rendered to avoid hydration issues) |
| `dist/swagger.html` | Interactive Swagger UI playground backed by the bundled spec |
| `redocly.yaml` | Linter configuration |
| `.github/workflows/validate.yml` | CI validation + GitHub Pages deploy |
| `scripts/polish_specs.py` | Normalizes public-facing descriptions, auth error coverage, and known docs inconsistencies across the master and sources |

## Coverage

Expand All @@ -36,10 +38,13 @@ The 26 capability files map to the official Wokelo docs set:

```bash
npm install
npm run polish-specs # normalize master + standalone files after spec refreshes
npm run lint # validate openapi.yaml
npm run preview # live-reload doc preview at http://localhost:8080
npm run bundle # produce dist/wokelo-openapi.yaml
npm run build-docs # produce dist/index.html
npm run build-docs # produce dist/index.html from the Redoc template
npm run build-docs-ssr # optional: generate Redocly's prerendered HTML for comparison/debugging
npm run build-playground # produce dist/swagger.html
npm run build # lint + bundle + docs
```

Expand All @@ -48,6 +53,7 @@ npm run build # lint + bundle + docs
- Canonical spec: `https://docs.wokelo.ai/openapi.yaml`
- Bundled spec: `https://raw.githubusercontent.com/Wokelo-AI/openapi/main/dist/wokelo-openapi.yaml`
- Hosted docs: `https://wokelo-ai.github.io/openapi/`
- Interactive playground: `https://wokelo-ai.github.io/openapi/swagger.html`

## Directory submissions

Expand All @@ -66,6 +72,23 @@ When submitting to external API directories, use the **bundled** URL so every `$

2. **The master spec is docs-authoritative.** This repo now follows the current official Wokelo docs and Postman collection. As part of the `2.0.0` refresh, the older direct primer endpoints (`/api/company_primer/v3/start/` and `/api/industry_primer/v3/start/`) were removed from the canonical spec because they are not part of the current official capability set.

3. **Redoc and interactive testing are split intentionally.** The published `dist/index.html` uses Redoc CE for the reference experience, while `dist/swagger.html` provides Swagger UI-based request execution against the same bundled OpenAPI file. Redocly's full hosted/API-docs products support a Try It console, but plain Redoc CE does not.

4. **The published Redoc page is client-rendered on purpose.** Redocly CLI's prerendered `build-docs` output currently produces browser-side hydration errors for this large spec even though the spec is valid. To keep the public docs clean, this repo publishes a client-rendered Redoc template at `dist/index.html` and keeps `npm run build-docs-ssr` only as an optional debugging path.

## Normalized doc inconsistencies

These are current inconsistencies in the upstream markdown docs or Postman material that the published OpenAPI intentionally normalizes:

- `POST /api/enterprise/request/cancel`
The markdown page declares `request_id` as a query parameter, but the official code samples and Postman collection send it in the JSON body. The spec models it as a request-body field.
- `POST /api/assets/upload/`
The markdown header parameter table says `Content-Type: application/json`, but the executable examples and Postman collection use `multipart/form-data`. The spec models the real multipart upload contract.
- `POST /api/wkl/notebook/configuration/`
The markdown endpoint line omits the leading slash, but the code samples and Postman collection include the canonical `/api/...` path. The spec keeps the canonical path.
- `POST /api/workflow_manager/start/` for Peer Comparison
The peer-comparison markdown endpoint omits the trailing slash while sibling workflow docs and Postman use `/api/workflow_manager/start/`. The spec keeps the trailing slash to match the live server path used elsewhere.

## Versioning

- OpenAPI version: `3.0.3`
Expand Down
1 change: 1 addition & 0 deletions dist/favicon.ico
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

773 changes: 62 additions & 711 deletions dist/index.html

Large diffs are not rendered by default.

77 changes: 77 additions & 0 deletions dist/swagger.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Wokelo API Playground</title>
<link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css" />
<style>
body {
margin: 0;
background: #f6f8fb;
color: #172033;
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
padding: 20px 24px;
background: linear-gradient(135deg, #0f172a, #1e293b);
color: #fff;
}

.topbar h1 {
margin: 0 0 8px;
font-size: 28px;
}

.topbar p {
margin: 0 0 12px;
max-width: 960px;
line-height: 1.5;
}

.topbar a {
color: #93c5fd;
}

.swagger-ui .topbar {
display: none;
}
</style>
</head>
<body>
<div class="topbar">
<h1>Wokelo API Playground</h1>
<p>
This page provides interactive browser-based testing for the bundled Wokelo OpenAPI spec.
Use the <strong>Authorize</strong> button with a bearer token from
<code>POST /auth/token/</code>, or return to the
<a href="./index.html">Redoc reference docs</a> for the narrative view.
</p>
<p>
Live requests are sent directly from the browser to <code>https://api.wokelo.ai</code>.
Wokelo currently exposes the CORS headers needed for this flow.
</p>
</div>
<div id="swagger-ui"></div>

<script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js"></script>
<script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-standalone-preset.js"></script>
<script>
window.ui = SwaggerUIBundle({
url: "./wokelo-openapi.yaml",
dom_id: "#swagger-ui",
deepLinking: true,
persistAuthorization: true,
displayOperationId: true,
displayRequestDuration: true,
tryItOutEnabled: true,
filter: true,
docExpansion: "list",
defaultModelsExpandDepth: 1,
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
layout: "BaseLayout"
});
</script>
</body>
</html>
Loading
Loading