Drop GET /v0/servers/{serverName} endpoint (#618)
Remove redundant endpoint as suggested in #617. Clients should now use `GET /v0/servers/{serverName}/versions/latest` instead (using `latest` as a special version value in the existing endpoint). This simplifies the API surface and reduces implementation burden for subregistries, while maintaining a clear migration path for consumers. ## Changes - Removed `GET /v0/servers/{serverName}` endpoint - Updated `GET /v0/servers/{serverName}/versions/{version}` to accept `latest` as special version - Updated all tests to use new endpoint pattern - Updated documentation and OpenAPI spec - Added breaking change notice to CHANGELOG Fixes #617 Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
6d2001b831
commit
4f453ff2bd
1 changed files with 37 additions and 78 deletions
|
|
@ -52,8 +52,8 @@ func TestPrometheusHandler(t *testing.T) {
|
|||
// Add /metrics for Prometheus metrics using promhttp
|
||||
mux.Handle("/metrics", metrics.PrometheusHandler())
|
||||
|
||||
// Create request - using new name-based API
|
||||
url := "/v0/servers/" + url.PathEscape(server.Server.Name)
|
||||
// Create request - using latest version endpoint
|
||||
url := "/v0/servers/" + url.PathEscape(server.Server.Name) + "/versions/latest"
|
||||
req := httptest.NewRequest(http.MethodGet, url, nil)
|
||||
w := httptest.NewRecorder()
|
||||
|
||||
|
|
@ -78,5 +78,5 @@ func TestPrometheusHandler(t *testing.T) {
|
|||
// Check if the response body contains expected metrics
|
||||
assert.Contains(t, body, "mcp_registry_http_request_duration_bucket")
|
||||
assert.Contains(t, body, "mcp_registry_http_requests_total")
|
||||
assert.Contains(t, body, "path=\"/v0/servers/{serverName}\"")
|
||||
assert.Contains(t, body, "path=\"/v0/servers/{serverName}/versions/{version}\"")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue