diff --git a/docs/changetracker/api/CLAUDE.md b/docs/changetracker/api/CLAUDE.md index 79e7bc1d2d..4bca6ae3fe 100644 --- a/docs/changetracker/api/CLAUDE.md +++ b/docs/changetracker/api/CLAUDE.md @@ -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 @@ -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 ``` diff --git a/src/theme/ApiExplorer/Server/index.tsx b/src/theme/ApiExplorer/Server/index.tsx index 0f335139be..08b42ded6e 100644 --- a/src/theme/ApiExplorer/Server/index.tsx +++ b/src/theme/ApiExplorer/Server/index.tsx @@ -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, @@ -79,7 +78,7 @@ function Server({ labelId }: ServerProps) { return (