Rename api/v1 -> api/v0 to match API paths (#320)

This PR renames the API paths from v1 to v0 to align with the actual API
versioning scheme.
This commit is contained in:
adam jones 2025-08-28 15:06:00 +01:00 • committed by GitHub
commit c0a94cca8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -11,7 +11,7 @@ import (
"github.com/modelcontextprotocol/registry/internal/config"
"github.com/modelcontextprotocol/registry/internal/service"
"github.com/modelcontextprotocol/registry/internal/validators"
apiv1 "github.com/modelcontextprotocol/registry/pkg/api/v1"
apiv0 "github.com/modelcontextprotocol/registry/pkg/api/v0"
)
// PublishServerInput represents the input for publishing a server
@ -35,7 +35,7 @@ func RegisterPublishEndpoint(api huma.API, registry service.RegistryService, cfg
Security: []map[string][]string{
{"bearer": {}},
},
}, func(ctx context.Context, input *PublishServerInput) (*Response[apiv1.ServerRecord], error) {
}, func(ctx context.Context, input *PublishServerInput) (*Response[apiv0.ServerRecord], error) {
// Extract bearer token
const bearerPrefix = "Bearer "
authHeader := input.Authorization
@ -56,7 +56,7 @@ func RegisterPublishEndpoint(api huma.API, registry service.RegistryService, cfg
}
// Parse the validated request body
var publishRequest apiv1.PublishRequest
var publishRequest apiv0.PublishRequest
if err := json.Unmarshal(input.RawBody, &publishRequest); err != nil {
return nil, huma.Error400BadRequest("Invalid JSON format", err)
}
@ -82,7 +82,7 @@ func RegisterPublishEndpoint(api huma.API, registry service.RegistryService, cfg
}
// Return the published server in extension wrapper format
return &Response[apiv1.ServerRecord]{
return &Response[apiv0.ServerRecord]{
Body: *publishedServer,
}, nil
})