fix!: omit name, avatar_url and last_seen_at from responses when empty (#18005)

User name, avatar URL, and last seen at, are not required fields so they
can be empty. Instead of returning the 0 values from Go, we want to make
it more agnostic, and omit them when they are empty. This make the docs
and usage way clearer for consumers.
This commit is contained in:
Bruno Quaresma
2025-05-23 11:35:05 -03:00
committed by GitHub
parent 96f69b8e13
commit 94c129c03d
11 changed files with 21 additions and 25 deletions

View File

@ -58,7 +58,7 @@ type WorkspaceBuild struct {
WorkspaceName string `json:"workspace_name"`
WorkspaceOwnerID uuid.UUID `json:"workspace_owner_id" format:"uuid"`
WorkspaceOwnerName string `json:"workspace_owner_name"`
WorkspaceOwnerAvatarURL string `json:"workspace_owner_avatar_url"`
WorkspaceOwnerAvatarURL string `json:"workspace_owner_avatar_url,omitempty"`
TemplateVersionID uuid.UUID `json:"template_version_id" format:"uuid"`
TemplateVersionName string `json:"template_version_name"`
BuildNumber int32 `json:"build_number"`