Skip to content

Align registry API with toolhive-registry-server v0.1 surface #5279

@rdimitrov

Description

@rdimitrov

Summary

Make toolhive's registry API a mirror of the v0.1 surface that stacklok/toolhive-registry-server exposes. This:

  • Drops the legacy-shaped /api/v1beta/registry/... endpoints.
  • Refactors the /registry/{registryName}/v0.1/servers handler to consume toolhive-core/registry/types directly (same pattern pkg/api/v1/registry_v01_skills.go already uses — no converters import).
  • Adds the per-version sub-resources that registry-server exposes but toolhive doesn't yet (servers and skills both).

Phase 1 (parse-side internals + error-code cleanup) is #5278.

Reference: registry-server's v0.1 surface

GET /registry/{registryName}/v0.1/servers
GET /registry/{registryName}/v0.1/servers/{serverName}/versions
GET /registry/{registryName}/v0.1/servers/{serverName}/versions/{version}
GET /registry/{registryName}/v0.1/x/dev.toolhive/skills
GET /registry/{registryName}/v0.1/x/dev.toolhive/skills/{namespace}/{name}
GET /registry/{registryName}/v0.1/x/dev.toolhive/skills/{namespace}/{name}/versions
GET /registry/{registryName}/v0.1/x/dev.toolhive/skills/{namespace}/{name}/versions/{version}

Source of truth: stacklok/toolhive-registry-server docs/thv-registry-api/swagger.yaml.

Scope

Remove:

  • pkg/api/v1/registry.go v1beta servers handlers (/api/v1beta/registry/{name}/servers, /{serverName}) and the legacy []*registry.ImageMetadata / []*registry.RemoteServerMetadata response structs.
  • pkg/api/v1/registry_v01_servers.go /versions/latest shortcut (replace with the version paths below).

Refactor:

  • pkg/api/v1/registry_v01_servers.go — drop the toolhive-core/registry/converters import; consume upstream types directly, mirroring pkg/api/v1/registry_v01_skills.go.
  • Internal registry provider chain — return upstream-shaped types instead of ImageMetadata / RemoteServerMetadata.

Add (to match registry-server surface):

  • GET /registry/{registryName}/v0.1/servers/{serverName}/versions
  • GET /registry/{registryName}/v0.1/servers/{serverName}/versions/{version}
  • GET /registry/{registryName}/v0.1/x/dev.toolhive/skills/{namespace}/{name}/versions
  • GET /registry/{registryName}/v0.1/x/dev.toolhive/skills/{namespace}/{name}/versions/{version}

Coordination

  • FE counterpart: studio currently consumes /api/v1beta/registry/{name}/servers and models RegistryItem around RegistryImageMetadata / RegistryRemoteServerMetadata. It needs to migrate to the new v0.1 surface — tracked separately.

Blocks

Acceptance criteria

  • /api/v1beta/registry/{name}/servers and /{serverName} removed.
  • No toolhive code imports toolhive-core/registry/converters.
  • No toolhive code references registry.ImageMetadata / registry.RemoteServerMetadata.
  • toolhive's v0.1 endpoint set matches registry-server's swagger.
  • OpenAPI spec regenerated; task docs green.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiItems related to the APIgoPull requests that update go coderegistry

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions