Skip to content

Commit c971b25

Browse files
committed
only return values if not zero
1 parent 1e1de11 commit c971b25

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

dbos/conductor_protocol.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,13 @@ func formatListWorkflowsResponseBody(wf WorkflowStatus) listWorkflowsConductorRe
114114
output.WorkflowName = &wf.Name
115115
}
116116

117-
// Copy optional fields
118-
output.AuthenticatedUser = &wf.AuthenticatedUser
119-
output.AssumedRole = &wf.AssumedRole
117+
// Convert identity fields
118+
if wf.AuthenticatedUser != "" {
119+
output.AuthenticatedUser = &wf.AuthenticatedUser
120+
}
121+
if wf.AssumedRole != "" {
122+
output.AssumedRole = &wf.AssumedRole
123+
}
120124
// Convert authenticated roles to JSON string if present
121125
if len(wf.AuthenticatedRoles) > 0 {
122126
rolesJSON, err := json.Marshal(wf.AuthenticatedRoles)

0 commit comments

Comments
 (0)