Skip to content

[O2B-1623] Document the dpl-detectors endpoint in the HTTP API documentation - #2266

Closed
graduta wants to merge 14 commits into
mainfrom
feature/O2B-1623/docs-dpl-detectors-endpoint
Closed

graduta wants to merge 14 commits into
mainfrom
feature/O2B-1623/docs-dpl-detectors-endpoint

Conversation

@graduta

@graduta graduta commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

I have a JIRA ticket

  • branch and/or PR name(s) include(s) JIRA ID
  • issue has "Fix version" assigned
  • issue "Status" is set to "In review"
  • PR labels are selected

Part of a stack of PRs documenting the HTTP API (O2B-1623), each PR builds on the previous one: see the stack on GitHub. The first PR of the stack is #2261, which adds the generator and the /api-docs page.

Notable changes for users:

  • The dpl-detectors endpoints are now documented at /api-docs, with parameters, responses and curl examples:
    • GET /api/dpl-detectors: all detectors as seen by the DPL processes (same entities as /api/detectors, without type)

Notable changes for developers:

  • lib/server/api-docs/openapi.yaml is updated by hand, API.md and index.html are regenerated with npm run docs:api (separate commit).

Changes made to the database:

  • None

🤖 Generated with Claude Code

claude added 14 commits October 20, 2026 14:38
Describe the tags endpoints (list, create, get by id or name, update, delete, logs of a tag) with parameters, schemas, errors, required roles and
examples. Operations that change data are flagged `x-llm-exclude: true`, and the spec carries instructions for LLMs (always paginate, 100 items max).
`npm run docs:api` builds `API.md` (Markdown with curl examples) and `index.html` (styled page, collapsible endpoints) from the OpenAPI spec.

- Fails when a non-GET operation does not declare `x-llm-exclude`
- Spec content is treated as untrusted when rendering: raw HTML is escaped, unsafe link schemes are dropped, and values put in curl examples are
  shell-quoted
- New devDependencies `js-yaml` (already in the lockfile through eslint) and `marked`, pinned to a release older than two weeks
Serve the generated HTML page (`/api-docs`), the Markdown version for LLMs (`/api-docs/API.md`) and the spec (`/api-docs/openapi.yaml`). The files
live under `lib/server` so that they are part of the Docker image.
- `GET /tags/:tagId/runs` was declared twice: once with a controller answering 501 and once with `TagsController.patchRun`, which does not exist,
  so the binder silently skipped it
- `GET /tags/:tagId/log` answered 501 as well

None of them is used by the GUI or covered by tests, and none did anything but advertise endpoints that do not exist. They now answer 404 like any
unknown route. The matching `getRuns` and `patchLog` stub controllers are removed.
… not a function

The route binder silently skipped routes whose controller was undefined (for example a typo or a missing export, as with the removed
`GET /tags/:tagId/runs`). It now throws, naming the route. Nodes that only group children, such as `/statistics` and `/dpl-process`, are not affected.

Unit tests check that every declared route binds, that grouping nodes are ignored, and that undefined controllers (alone or inside a list) are rejected.
Add GET /status/database and GET /status/gui, and reword the work-in-progress note now that more than one resource is documented.
@graduta
graduta added this pull request to stack #2265 October 20, 2026 12:56
@graduta
graduta requested a review from isaachilly as a code owner October 20, 2026 12:56
@graduta graduta changed the title feature/O2B 1623/docs dpl detectors endpoint [O2B-1623] Document the dpl-detectors endpoint in the HTTP API documentation Oct 20, 2026
@graduta graduta added documentation Improvements or additions to documentation backend labels Oct 20, 2026
@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.46%. Comparing base (d1c77c1) to head (e7d3214).

Additional details and impacted files
@@                             Coverage Diff                              @@
##           feature/O2B-1623/docs-detectors-endpoint    #2266      +/-   ##
============================================================================
- Coverage                                     46.47%   46.46%   -0.01%     
============================================================================
  Files                                          1053     1053              
  Lines                                         17359    17359              
  Branches                                       3162     3162              
============================================================================
- Hits                                           8067     8066       -1     
- Misses                                         9292     9293       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@graduta
graduta force-pushed the feature/O2B-1623/docs-detectors-endpoint branch 2 times, most recently from 30b596e to a545ba4 Compare October 22, 2026 08:52
Base automatically changed from feature/O2B-1623/docs-detectors-endpoint to main October 22, 2026 09:00
@graduta

graduta commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

Closing: GET /api/dpl-detectors is unused (no frontend call, the DPL detectors table was merged into detectors) and is removed in #2275, so it should not be documented.

@graduta graduta closed this Oct 22, 2026
@graduta
graduta removed this pull request from stack #2265 October 22, 2026 09:29
@graduta
graduta deleted the feature/O2B-1623/docs-dpl-detectors-endpoint branch October 22, 2026 11:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend documentation Improvements or additions to documentation

Development

Successfully merging this pull request may close these issues.

2 participants