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:
adam jones 2025-10-07 11:56:45 +01:00 • committed by GitHub
commit 4f453ff2bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -114,7 +114,7 @@ func TestListServersEndpoint(t *testing.T) {
}
}
func TestGetServerByNameEndpoint(t *testing.T) {
func TestGetLatestServerVersionEndpoint(t *testing.T) {
ctx := context.Background()
registryService := service.NewRegistryService(database.NewTestDB(t), config.NewConfig())
@ -139,7 +139,7 @@ func TestGetServerByNameEndpoint(t *testing.T) {
expectedError string
}{
{
name: "get existing server",
name: "get existing server latest version",
serverName: "com.example/detail-server",
expectedStatus: http.StatusOK,
},
@ -155,7 +155,7 @@ func TestGetServerByNameEndpoint(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
// URL encode the server name
encodedName := url.PathEscape(tt.serverName)
req := httptest.NewRequest(http.MethodGet, "/v0/servers/"+encodedName, nil)
req := httptest.NewRequest(http.MethodGet, "/v0/servers/"+encodedName+"/versions/latest", nil)
w := httptest.NewRecorder()
mux.ServeHTTP(w, req)
@ -434,9 +434,9 @@ func TestServersEndpointEdgeCases(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
// Test server detail endpoint
// Test latest version endpoint
encodedName := url.PathEscape(tt.serverName)
req := httptest.NewRequest(http.MethodGet, "/v0/servers/"+encodedName, nil)
req := httptest.NewRequest(http.MethodGet, "/v0/servers/"+encodedName+"/versions/latest", nil)
w := httptest.NewRecorder()
mux.ServeHTTP(w, req)