Clean up schema by simplifying version structure (#379)
## Summary Simplified the schema structure by: - Replacing `version_detail.version` with direct `version` field - Removing unused `release_date` field from seed data - Updating all API types, models, and tests to match new structure - Maintaining backwards compatibility in API responses This change makes the schema more intuitive and reduces nesting depth.
This commit is contained in:
parent
f51c187e52
commit
f975e68cf2
1 changed files with 540 additions and 1973 deletions
|
|
@ -18,9 +18,7 @@ func TestValidateNoDuplicateRemoteURLs(t *testing.T) {
|
|||
"existing1": {
|
||||
Name: "com.example/existing-server",
|
||||
Description: "An existing server",
|
||||
VersionDetail: model.VersionDetail{
|
||||
Version: "1.0.0",
|
||||
},
|
||||
Version: "1.0.0",
|
||||
Remotes: []model.Transport{
|
||||
{Type: "streamable-http", URL: "https://api.example.com/mcp"},
|
||||
{Type: "sse", URL: "https://webhook.example.com/sse"},
|
||||
|
|
@ -29,9 +27,7 @@ func TestValidateNoDuplicateRemoteURLs(t *testing.T) {
|
|||
"existing2": {
|
||||
Name: "com.microsoft/another-server",
|
||||
Description: "Another existing server",
|
||||
VersionDetail: model.VersionDetail{
|
||||
Version: "1.0.0",
|
||||
},
|
||||
Version: "1.0.0",
|
||||
Remotes: []model.Transport{
|
||||
{Type: "streamable-http", URL: "https://api.microsoft.com/mcp"},
|
||||
},
|
||||
|
|
@ -59,9 +55,7 @@ func TestValidateNoDuplicateRemoteURLs(t *testing.T) {
|
|||
serverDetail: apiv0.ServerJSON{
|
||||
Name: "com.example/new-server",
|
||||
Description: "A new server with no remotes",
|
||||
VersionDetail: model.VersionDetail{
|
||||
Version: "1.0.0",
|
||||
},
|
||||
Version: "1.0.0",
|
||||
Remotes: []model.Transport{},
|
||||
},
|
||||
expectError: false,
|
||||
|
|
@ -71,9 +65,7 @@ func TestValidateNoDuplicateRemoteURLs(t *testing.T) {
|
|||
serverDetail: apiv0.ServerJSON{
|
||||
Name: "com.example/new-server",
|
||||
Description: "A new server",
|
||||
VersionDetail: model.VersionDetail{
|
||||
Version: "1.0.0",
|
||||
},
|
||||
Version: "1.0.0",
|
||||
Remotes: []model.Transport{
|
||||
{Type: "streamable-http", URL: "https://new.example.com/mcp"},
|
||||
{Type: "sse", URL: "https://unique.example.com/sse"},
|
||||
|
|
@ -86,9 +78,7 @@ func TestValidateNoDuplicateRemoteURLs(t *testing.T) {
|
|||
serverDetail: apiv0.ServerJSON{
|
||||
Name: "com.example/new-server",
|
||||
Description: "A new server with duplicate URL",
|
||||
VersionDetail: model.VersionDetail{
|
||||
Version: "1.0.0",
|
||||
},
|
||||
Version: "1.0.0",
|
||||
Remotes: []model.Transport{
|
||||
{Type: "streamable-http", URL: "https://api.example.com/mcp"}, // This URL already exists
|
||||
},
|
||||
|
|
@ -101,9 +91,7 @@ func TestValidateNoDuplicateRemoteURLs(t *testing.T) {
|
|||
serverDetail: apiv0.ServerJSON{
|
||||
Name: "com.example/existing-server", // Same name as existing
|
||||
Description: "Updated existing server",
|
||||
VersionDetail: model.VersionDetail{
|
||||
Version: "1.1.0",
|
||||
},
|
||||
Version: "1.1.0",
|
||||
Remotes: []model.Transport{
|
||||
{Type: "streamable-http", URL: "https://api.example.com/mcp"}, // Same URL as before
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue