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
16 changes: 3 additions & 13 deletions docs/changetracker/api/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,9 @@ api/

**Source:** `static/openapi/changetracker-hub-8.2.yaml`

This spec is auto-generated by ASP.NET Swashbuckle. A key consequence: Swashbuckle exposes both GET and POST on virtually every endpoint (GET takes query-string params, POST takes a form body — same operation, different parameter-passing conventions). The generated reference would otherwise list every endpoint twice.
This spec is auto-generated by ASP.NET Swashbuckle. A key consequence: Swashbuckle exposes both GET and POST on virtually every endpoint (GET takes query-string params, POST takes a form body — same operation, different parameter-passing conventions). The generated reference publishes every GET and POST operation exactly as defined in the spec — no deduplication.

### Deduplication

`scripts/deduplicate-openapi-methods.mjs` removes the semantically incorrect method from each dual-method endpoint (keeps GET for reads, POST for mutations). It is:

- **Idempotent** — if the spec is already clean, it exits without touching the file.
- **Automatic in CI** — the `openapi-dedup` GitHub Actions workflow runs it whenever the YAML changes in a PR and commits the result back to the branch.
- **Automatic on every build** — wired into `prestart`, `prebuild`, and `preci` in `package.json`, so it always runs before `gen-api-docs`.

**17 endpoints intentionally keep both GET and POST** (auth flows, downloads, report rendering, and two `commandParser` endpoints where GET and POST do genuinely different things). These are listed in the `KEEP_BOTH` set at the top of the script.

When the API team ships a new spec, no manual action is needed — push the YAML and the CI workflow handles the rest. For a full local refresh (dedup + clean stale pages + regenerate):
When the API team ships a new spec, no manual action is needed — push the YAML. For a full local refresh (clean stale pages + regenerate):

```bash
npm run openapi:sync
Expand All @@ -50,7 +40,7 @@ The MDX files under `reference/` are gitignored (except `_category_.json` and `i
# Full refresh — use when the OpenAPI spec has changed
npm run openapi:sync

# Quick regenerate only (no clean, no dedup — safe for minor changes)
# Quick regenerate only (safe for minor changes)
npx docusaurus gen-api-docs changetracker-hub
```

Expand Down
3 changes: 1 addition & 2 deletions src/theme/ApiExplorer/Server/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import FormItem from "@theme/ApiExplorer/FormItem";
import FormSelect from "@theme/ApiExplorer/FormSelect";
import FormTextInput from "@theme/ApiExplorer/FormTextInput";
import { useTypedDispatch, useTypedSelector } from "@theme/ApiItem/hooks";
import { OPENAPI_SERVER } from "@theme/translationIds";

import {
setServer,
Expand Down Expand Up @@ -79,7 +78,7 @@ function Server({ labelId }: ServerProps) {
return (
<FloatingButton
onClick={handleEditClick}
label={translate({ id: OPENAPI_SERVER.EDIT_BUTTON, message: "Edit" })}
label={translate({ id: "theme.openapi.server.editButton", message: "Edit" })}
>
<FormItem>
<span className="openapi-explorer__server-url" title={url}>
Expand Down
Loading