umb-update-openapi
Installation
SKILL.md
Update Management API OpenApi.json (Umbraco CMS)
Refresh src/Umbraco.Cms.Api.Management/OpenApi.json byte-for-byte from a running backend's OpenAPI document, then optionally regenerate the backoffice hey-api client so its generated types match.
This replaces the old manual routine (run the app, open OpenAPI UI, copy JSON, paste, fix formatting). The point of automating it is that a byte-for-byte fetch from the canonical endpoint is deterministic — there's no editor reformatting to strip out, and repeated runs produce identical output.
Run from the repository root (the directory containing umbraco.sln). Bash's working directory persists between calls, but cd can trigger a permission prompt — prefer paths relative to the repo root over cd.
Key facts
- OpenAPI endpoint:
/umbraco/openapi/management.json, served over HTTPS with a dev cert. OpenApi is only mapped when the environment is not Production — a backend running in Production returns 404 here even though it's healthy. - Port: default
44339(thelaunchSettings.jsonhttps profile). Assume it unless the user says otherwise. - Target file:
src/Umbraco.Cms.Api.Management/OpenApi.json— git-tracked, so git is the safety net for a bad fetch. - The mechanical work is a script, not this document.
npm run generate:openapifetches, validates and writes the spec;npm run generate:server-apithen regenerates the client from the committed file. Prefer these over hand-rolledcurl. - Keep those two commands separate — never chain them into one. The client generator reads the committed
OpenApi.jsonand only that. Pointing it at a live server instead has been tried and removed (b8c2a3366fd): it broke base-url handling, and worse, it produced a client with no matching committed schema. Schema and client belong in the same commit. - This skill exists for the parts a script can't do: knowing when to run it, managing the backend lifecycle, and reading the diff.