Skip to content

fix: generate .ts from openapi spec#237

Merged
timflannagan merged 1 commit intomainfrom
peterj/apigenui
Mar 2, 2026
Merged

fix: generate .ts from openapi spec#237
timflannagan merged 1 commit intomainfrom
peterj/apigenui

Conversation

@peterj
Copy link
Copy Markdown
Contributor

@peterj peterj commented Feb 27, 2026

Description

Replace the manually maintained UI API client (admin-api.ts) with an auto-generated TypeScript client from the backend's OpenAPI spec. This eliminates an entire class of UI-backend mismatches.

  • Rewrote cmd/tools/gen-openapi to produce an OpenAPI spec directly from Huma route registrations
  • Added @hey-api/openapi-ts to auto-generate typed SDK functions + types from the spec
  • Migrated all 13 UI files from the old adminApiClient class to the generated SDK
  • Added make gen-client target and CI verification (make verify now catches stale generated files)
  • Removed the "Published" tab (publishing is implicit on creation) and renamed "Admin" to "Catalog"
  • Replaced tab navigation with clickable category cards (closes UI servers/skills/agents tabs a bit confusing #157)

whenever there's a change to the APIs in the backend, you do:

make gen-client        # regenerates openapi.yaml + TypeScript client
cd ui && npx tsc --noEmit  # shows any UI code that needs updating

The CI will run make verify which will fail if the files are stale.

Change Type

/kind feature
/kind cleanup

Changelog

Auto-generate TypeScript API client from OpenAPI spec, replacing the manually maintained admin-api.ts. Run `make gen-client` after API changes.

@timflannagan timflannagan added this pull request to the merge queue Mar 2, 2026
Merged via the queue into main with commit 54549b2 Mar 2, 2026
6 checks passed
christian-posta pushed a commit to christian-posta/agentregistry that referenced this pull request Mar 9, 2026
Replace the manually maintained UI API client (`admin-api.ts`) with an
auto-generated TypeScript client from the backend's OpenAPI spec. This
eliminates an entire class of UI-backend mismatches.

- Rewrote `cmd/tools/gen-openapi` to produce an OpenAPI spec directly
from Huma route registrations
- Added `@hey-api/openapi-ts` to auto-generate typed SDK functions +
types from the spec
- Migrated all 13 UI files from the old `adminApiClient` class to the
generated SDK
- Added `make gen-client` target and CI verification (`make verify` now
catches stale generated files)
- Removed the "Published" tab (publishing is implicit on creation) and
renamed "Admin" to "Catalog"
- Replaced tab navigation with clickable category cards (closes agentregistry-dev#157)

whenever there's a change to the APIs in the backend, you do:

```
make gen-client        # regenerates openapi.yaml + TypeScript client
cd ui && npx tsc --noEmit  # shows any UI code that needs updating
```

The CI will run `make verify` which will fail if the files are stale.

```
/kind feature
/kind cleanup
```

```release-note
Auto-generate TypeScript API client from OpenAPI spec, replacing the manually maintained admin-api.ts. Run `make gen-client` after API changes.
```

Signed-off-by: Peter Jausovec <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI servers/skills/agents tabs a bit confusing

2 participants