Skip to content

Commit d9c8c4f

Browse files
committed
browser-emulator: add OpenAPI docs
1 parent a0119db commit d9c8c4f

10 files changed

Lines changed: 2324 additions & 11 deletions

File tree

AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,17 @@ When modifying browser-emulator code:
178178
- Update `AGENTS.md` if new commands, build steps, or conventions are introduced
179179
- Document new configuration options in README or docs/
180180

181+
#### API Documentation (browser-emulator)
182+
183+
The browser-emulator exposes a REST and WebSocket API used by:
184+
- loadtest-controller
185+
- Client websites in `public/` and `public-lk/`
186+
187+
When adding, removing, or modifying API endpoints:
188+
189+
1. **Update `docs/openapi.yaml`** with the new/changed endpoint and schema
190+
2. **Regenerate HTML docs**: Run `pnpm run docs` to update `docs/index.html`
191+
181192
### 5. Pre-commit Checklist
182193

183194
Before finalizing any task:

browser-emulator/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@ This app provides a simple **REST API** that will be used by **loadtest-controll
88

99
This services also is listening for a **WebSocket communication**. It will send information from the clients to the loadtest-controller.
1010

11+
## API Documentation
12+
13+
The REST and WebSocket APIs are documented in the following files:
14+
15+
- **OpenAPI spec**: [docs/openapi.yaml](docs/openapi.yaml)
16+
- **HTML documentation**: [docs/index.html](docs/index.html)
17+
18+
You can view the HTML docs directly in a browser or host them statically. For GitHub integration, you can use [raw.githubusercontent.com](https://raw.githubusercontent.com) to serve the HTML file.
19+
20+
To regenerate the docs after changes to the API:
21+
22+
```bash
23+
pnpm run docs
24+
```
25+
1126
# Browser Emulator development
1227

1328
## Development Requirements and Constraints

browser-emulator/docs/index.html

Lines changed: 574 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)