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

@ -17,7 +17,7 @@ import (
"github.com/modelcontextprotocol/registry/internal/auth"
"github.com/modelcontextprotocol/registry/internal/config"
"github.com/modelcontextprotocol/registry/internal/service"
apiv1 "github.com/modelcontextprotocol/registry/pkg/api/v1"
apiv0 "github.com/modelcontextprotocol/registry/pkg/api/v0"
"github.com/modelcontextprotocol/registry/pkg/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@ -54,7 +54,7 @@ func TestPublishIntegration(t *testing.T) {
v0.RegisterPublishEndpoint(api, registryService, testConfig)
t.Run("successful publish with GitHub auth", func(t *testing.T) {
publishReq := apiv1.PublishRequest{
publishReq := apiv0.PublishRequest{
Server: model.ServerJSON{
Name: "io.github.testuser/test-mcp-server",
Description: "A test MCP server for integration testing",
@ -92,7 +92,7 @@ func TestPublishIntegration(t *testing.T) {
assert.Equal(t, http.StatusOK, rr.Code)
var response apiv1.ServerRecord
var response apiv0.ServerRecord
err = json.Unmarshal(rr.Body.Bytes(), &response)
require.NoError(t, err)
@ -101,7 +101,7 @@ func TestPublishIntegration(t *testing.T) {
})
t.Run("successful publish with none auth (no prefix)", func(t *testing.T) {
publishReq := apiv1.PublishRequest{
publishReq := apiv0.PublishRequest{
Server: model.ServerJSON{
Name: "com.example/test-mcp-server-no-auth",
Description: "A test MCP server without authentication",
@ -138,7 +138,7 @@ func TestPublishIntegration(t *testing.T) {
assert.Equal(t, http.StatusOK, rr.Code)
var response apiv1.ServerRecord
var response apiv0.ServerRecord
err = json.Unmarshal(rr.Body.Bytes(), &response)
require.NoError(t, err)
@ -146,7 +146,7 @@ func TestPublishIntegration(t *testing.T) {
})
t.Run("publish fails with missing authorization header", func(t *testing.T) {
publishReq := apiv1.PublishRequest{
publishReq := apiv0.PublishRequest{
Server: model.ServerJSON{
Name: "test-server",
},
@ -167,7 +167,7 @@ func TestPublishIntegration(t *testing.T) {
})
t.Run("publish fails with invalid token", func(t *testing.T) {
publishReq := apiv1.PublishRequest{
publishReq := apiv0.PublishRequest{
Server: model.ServerJSON{
Name: "test-server",
},
@ -188,7 +188,7 @@ func TestPublishIntegration(t *testing.T) {
})
t.Run("publish fails when permission denied", func(t *testing.T) {
publishReq := apiv1.PublishRequest{
publishReq := apiv0.PublishRequest{
Server: model.ServerJSON{
Name: "io.github.other/test-server",
Description: "A test server",