Skip to content

Commit 3a1d18d

Browse files
committed
improve comment
1 parent 14dd881 commit 3a1d18d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/response/optimize.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ func optimizeObject(raw []byte, depth int) ([]byte, error) {
152152
return nil, fmt.Errorf("failed to unmarshal JSON: %w", err)
153153
}
154154

155-
// find the actual data array within the wrapper; rest is metadata to be preserved as is
155+
// find the first array field in the wrapper (data); rest is metadata to be preserved as is
156+
// assumes exactly one array field exists; if multiple are present, only the first will be optimized
156157
var dataKey string
157158
for key, value := range wrapper {
158159
if _, ok := value.([]any); ok {

0 commit comments

Comments
 (0)