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:
adam jones 2025-09-08 14:32:59 -07:00 • committed by GitHub
commit f975e68cf2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -163,7 +163,7 @@ func runPublisher(filePath string) (string, error) {
// Add a small delay to ensure database consistency
time.Sleep(100 * time.Millisecond)
// Find the server in the registry by name
return findServerIDByName(serverName)
}
@ -315,17 +315,15 @@ func compareServerJSON(expected, actual *apiv0.ServerJSON) error {
if expected.Status != actual.Status {
return fmt.Errorf("status mismatch: expected %q, got %q", expected.Status, actual.Status)
}
if expected.Version != actual.Version {
return fmt.Errorf("version mismatch: expected %+v, got %+v", expected.Version, actual.Version)
}
// Compare repository
if !reflect.DeepEqual(expected.Repository, actual.Repository) {
return fmt.Errorf("repository mismatch: expected %+v, got %+v", expected.Repository, actual.Repository)
}
// Compare version detail
if !reflect.DeepEqual(expected.VersionDetail, actual.VersionDetail) {
return fmt.Errorf("version detail mismatch: expected %+v, got %+v", expected.VersionDetail, actual.VersionDetail)
}
// Compare packages
if !reflect.DeepEqual(expected.Packages, actual.Packages) {
return fmt.Errorf("packages mismatch: expected %+v, got %+v", expected.Packages, actual.Packages)