Skip to content

Commit 2dd87f4

Browse files
committed
fixed issue where *string in a response structure isn't correctly encoded (if the value is nil) correctly
1 parent 44a52a8 commit 2dd87f4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

values.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,12 @@ func isNullish(value interface{}) bool {
320320
if value, ok := value.(string); ok {
321321
return value == ""
322322
}
323+
if value, ok := value.(*string); ok {
324+
if value == nil {
325+
return true
326+
}
327+
return *value == ""
328+
}
323329
if value, ok := value.(int); ok {
324330
return math.IsNaN(float64(value))
325331
}

0 commit comments

Comments
 (0)