refactor: consolidate server list response types (#387)

## Summary
- Consolidate ServerListResponse and Metadata types into pkg/api/v0
- Remove duplication between handler and API types
- Change metadata from optional pointer to required value
- Remove unused Total field from Metadata
This commit is contained in:
adam jones 2025-09-09 04:47:27 -07:00 • committed by GitHub
commit 0eada9b3b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,7 +17,7 @@ type RegistryExtensions struct {
// ServerListResponse represents the paginated server list response
type ServerListResponse struct {
Servers []ServerJSON `json:"servers"`
Metadata *Metadata `json:"metadata,omitempty"`
Metadata Metadata `json:"metadata"`
}
// ServerMeta represents the structured metadata with known extension fields
@ -42,6 +42,5 @@ type ServerJSON struct {
// Metadata represents pagination metadata
type Metadata struct {
NextCursor string `json:"next_cursor,omitempty"`
Count int `json:"count,omitempty"`
Total int `json:"total,omitempty"`
Count int `json:"count"`
}