api/v2: send empty route lists under fields=all

This commit is contained in:
Kristoffer Dalby committed 2026-10-28 16:35:22 +00:00
1 parent 7f181a27b9
commit ca259fbfb7
3 files changed
+19 -12

No files matched your search

+3 -3
View File
@@ -46,9 +46,9 @@ type Device struct {
// does not record, so it is left out.
OAuthClientID string `json:"oauthClientId,omitempty"`
// Populated only when fields=all is requested.
AdvertisedRoutes []string `json:"advertisedRoutes,omitempty"`
EnabledRoutes []string `json:"enabledRoutes,omitempty"`
// Populated only when fields=all is requested, then as [] when empty.
AdvertisedRoutes []string `json:"advertisedRoutes,omitzero"`
EnabledRoutes []string `json:"enabledRoutes,omitzero"`
}
// DeviceRoutes is the GET /device/{id}/routes response: what the node announces