@@ -17,7 +17,7 @@ import (
1717 "github.com/modelcontextprotocol/registry/internal/auth"
1818 "github.com/modelcontextprotocol/registry/internal/config"
1919 "github.com/modelcontextprotocol/registry/internal/database"
20- apiv1 "github.com/modelcontextprotocol/registry/pkg/api/v1 "
20+ apiv0 "github.com/modelcontextprotocol/registry/pkg/api/v0 "
2121 "github.com/modelcontextprotocol/registry/pkg/model"
2222)
2323
@@ -45,7 +45,7 @@ func TestEditServerEndpoint(t *testing.T) {
4545 })
4646 return "Bearer " + token
4747 }(),
48- requestBody : apiv1 .PublishRequest {
48+ requestBody : apiv0 .PublishRequest {
4949 Server : model.ServerJSON {
5050 Name : "io.github.domdomegg/test-server" ,
5151 Description : "Updated test server" ,
@@ -62,7 +62,7 @@ func TestEditServerEndpoint(t *testing.T) {
6262 },
6363 setupMocks : func (registry * MockRegistryService ) {
6464 // Current server (not deleted)
65- currentServer := & apiv1 .ServerRecord {
65+ currentServer := & apiv0 .ServerRecord {
6666 Server : model.ServerJSON {
6767 Name : "io.github.domdomegg/test-server" ,
6868 Description : "Original server" ,
@@ -71,22 +71,22 @@ func TestEditServerEndpoint(t *testing.T) {
7171 }
7272 registry .On ("GetByID" , "550e8400-e29b-41d4-a716-446655440001" ).Return (currentServer , nil )
7373
74- expectedResponse := & apiv1 .ServerRecord {
74+ expectedResponse := & apiv0 .ServerRecord {
7575 Server : model.ServerJSON {
7676 Name : "io.github.domdomegg/test-server" ,
7777 Description : "Updated test server" ,
7878 Status : model .StatusDeprecated ,
7979 },
8080 }
81- registry .On ("EditServer" , "550e8400-e29b-41d4-a716-446655440001" , mock .AnythingOfType ("v1 .PublishRequest" )).Return (expectedResponse , nil )
81+ registry .On ("EditServer" , "550e8400-e29b-41d4-a716-446655440001" , mock .AnythingOfType ("v0 .PublishRequest" )).Return (expectedResponse , nil )
8282 },
8383 expectedStatus : http .StatusOK ,
8484 },
8585 {
8686 name : "missing authorization header" ,
8787 serverID : "550e8400-e29b-41d4-a716-446655440001" ,
8888 authHeader : "" ,
89- requestBody : apiv1 .PublishRequest {},
89+ requestBody : apiv0 .PublishRequest {},
9090 setupMocks : func (_ * MockRegistryService ) {},
9191 expectedStatus : 422 ,
9292 expectedError : "required header parameter is missing" ,
@@ -95,7 +95,7 @@ func TestEditServerEndpoint(t *testing.T) {
9595 name : "invalid authorization header format" ,
9696 serverID : "550e8400-e29b-41d4-a716-446655440001" ,
9797 authHeader : "InvalidFormat token123" ,
98- requestBody : apiv1 .PublishRequest {},
98+ requestBody : apiv0 .PublishRequest {},
9999 setupMocks : func (_ * MockRegistryService ) {},
100100 expectedStatus : http .StatusUnauthorized ,
101101 expectedError : "Unauthorized" ,
@@ -104,7 +104,7 @@ func TestEditServerEndpoint(t *testing.T) {
104104 name : "invalid token" ,
105105 serverID : "550e8400-e29b-41d4-a716-446655440001" ,
106106 authHeader : "Bearer invalid-token" ,
107- requestBody : apiv1 .PublishRequest {},
107+ requestBody : apiv0 .PublishRequest {},
108108 setupMocks : func (_ * MockRegistryService ) {},
109109 expectedStatus : http .StatusUnauthorized ,
110110 expectedError : "Unauthorized" ,
@@ -123,15 +123,15 @@ func TestEditServerEndpoint(t *testing.T) {
123123 })
124124 return "Bearer " + token
125125 }(),
126- requestBody : apiv1 .PublishRequest {
126+ requestBody : apiv0 .PublishRequest {
127127 Server : model.ServerJSON {
128128 Name : "io.github.domdomegg/test-server" ,
129129 Description : "Updated test server" ,
130130 },
131131 },
132132 setupMocks : func (registry * MockRegistryService ) {
133133 // Need to mock GetByID since we check permissions against existing server name
134- currentServer := & apiv1 .ServerRecord {
134+ currentServer := & apiv0 .ServerRecord {
135135 Server : model.ServerJSON {
136136 Name : "io.github.domdomegg/test-server" ,
137137 Description : "Original server" ,
@@ -157,7 +157,7 @@ func TestEditServerEndpoint(t *testing.T) {
157157 })
158158 return "Bearer " + token
159159 }(),
160- requestBody : apiv1 .PublishRequest {
160+ requestBody : apiv0 .PublishRequest {
161161 Server : model.ServerJSON {
162162 Name : "io.github.other/test-server" ,
163163 Description : "Updated test server" ,
@@ -166,7 +166,7 @@ func TestEditServerEndpoint(t *testing.T) {
166166 setupMocks : func (registry * MockRegistryService ) {
167167 // Need to mock GetByID since we check permissions against existing server name
168168 // This test case shows a different scenario: existing server is "other" but user only has perms for "domdomegg"
169- currentServer := & apiv1 .ServerRecord {
169+ currentServer := & apiv0 .ServerRecord {
170170 Server : model.ServerJSON {
171171 Name : "io.github.other/test-server" ,
172172 Description : "Original server" ,
@@ -192,7 +192,7 @@ func TestEditServerEndpoint(t *testing.T) {
192192 })
193193 return "Bearer " + token
194194 }(),
195- requestBody : apiv1 .PublishRequest {
195+ requestBody : apiv0 .PublishRequest {
196196 Server : model.ServerJSON {
197197 Name : "io.github.domdomegg/test-server" ,
198198 Description : "Updated test server" ,
@@ -218,23 +218,23 @@ func TestEditServerEndpoint(t *testing.T) {
218218 })
219219 return "Bearer " + token
220220 }(),
221- requestBody : apiv1 .PublishRequest {
221+ requestBody : apiv0 .PublishRequest {
222222 Server : model.ServerJSON {
223223 Name : "io.github.domdomegg/test-server" ,
224224 Description : "Updated test server" ,
225225 },
226226 },
227227 setupMocks : func (registry * MockRegistryService ) {
228228 // Current server (not deleted)
229- currentServer := & apiv1 .ServerRecord {
229+ currentServer := & apiv0 .ServerRecord {
230230 Server : model.ServerJSON {
231231 Name : "io.github.domdomegg/test-server" ,
232232 Description : "Original server" ,
233233 Status : model .StatusActive ,
234234 },
235235 }
236236 registry .On ("GetByID" , "550e8400-e29b-41d4-a716-446655440001" ).Return (currentServer , nil )
237- registry .On ("EditServer" , "550e8400-e29b-41d4-a716-446655440001" , mock .AnythingOfType ("v1 .PublishRequest" )).Return (nil , errors .New ("database error" ))
237+ registry .On ("EditServer" , "550e8400-e29b-41d4-a716-446655440001" , mock .AnythingOfType ("v0 .PublishRequest" )).Return (nil , errors .New ("database error" ))
238238 },
239239 expectedStatus : http .StatusBadRequest ,
240240 expectedError : "Bad Request" ,
@@ -272,7 +272,7 @@ func TestEditServerEndpoint(t *testing.T) {
272272 })
273273 return "Bearer " + token
274274 }(),
275- requestBody : apiv1 .PublishRequest {
275+ requestBody : apiv0 .PublishRequest {
276276 Server : model.ServerJSON {
277277 Name : "io.github.domdomegg/test-server" ,
278278 Description : "Trying to undelete server" ,
@@ -281,7 +281,7 @@ func TestEditServerEndpoint(t *testing.T) {
281281 },
282282 setupMocks : func (registry * MockRegistryService ) {
283283 // Current server is deleted
284- currentServer := & apiv1 .ServerRecord {
284+ currentServer := & apiv0 .ServerRecord {
285285 Server : model.ServerJSON {
286286 Name : "io.github.domdomegg/test-server" ,
287287 Description : "Original server" ,
0 commit comments