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
|
|
@ -47,9 +47,7 @@ func TestPublishRegistryValidation(t *testing.T) {
|
|||
publishReq := apiv0.ServerJSON{
|
||||
Name: "com.example/test-server-with-npm",
|
||||
Description: "A test server with invalid npm package reference",
|
||||
VersionDetail: model.VersionDetail{
|
||||
Version: "1.0.0",
|
||||
},
|
||||
Version: "1.0.0",
|
||||
Packages: []model.Package{
|
||||
{
|
||||
RegistryType: model.RegistryTypeNPM,
|
||||
|
|
@ -90,9 +88,7 @@ func TestPublishRegistryValidation(t *testing.T) {
|
|||
publishReq := apiv0.ServerJSON{
|
||||
Name: "com.example/test-server-mcpb-validation",
|
||||
Description: "A test server with MCPB package and registry validation enabled",
|
||||
VersionDetail: model.VersionDetail{
|
||||
Version: "0.0.36",
|
||||
},
|
||||
Version: "0.0.36",
|
||||
Packages: []model.Package{
|
||||
{
|
||||
RegistryType: model.RegistryTypeMCPB,
|
||||
|
|
@ -133,7 +129,7 @@ func TestPublishRegistryValidation(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, publishReq.Name, response.Name)
|
||||
assert.Equal(t, publishReq.VersionDetail.Version, response.VersionDetail.Version)
|
||||
assert.Equal(t, publishReq.Version, response.Version)
|
||||
assert.Len(t, response.Packages, 1)
|
||||
assert.Equal(t, model.RegistryTypeMCPB, response.Packages[0].RegistryType)
|
||||
})
|
||||
|
|
@ -142,9 +138,7 @@ func TestPublishRegistryValidation(t *testing.T) {
|
|||
publishReq := apiv0.ServerJSON{
|
||||
Name: "com.example/test-server-multiple-packages",
|
||||
Description: "A test server with multiple packages where second fails",
|
||||
VersionDetail: model.VersionDetail{
|
||||
Version: "1.0.0",
|
||||
},
|
||||
Version: "1.0.0",
|
||||
Packages: []model.Package{
|
||||
{
|
||||
RegistryType: model.RegistryTypeMCPB,
|
||||
|
|
@ -195,9 +189,7 @@ func TestPublishRegistryValidation(t *testing.T) {
|
|||
publishReq := apiv0.ServerJSON{
|
||||
Name: "com.example/test-server-first-package-fails",
|
||||
Description: "A test server where first package fails",
|
||||
VersionDetail: model.VersionDetail{
|
||||
Version: "1.0.0",
|
||||
},
|
||||
Version: "1.0.0",
|
||||
Packages: []model.Package{
|
||||
{
|
||||
RegistryType: model.RegistryTypeNPM,
|
||||
|
|
|
|||
Loading…
Reference in a new issue