summaryrefslogtreecommitdiff
path: root/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-04-29 09:18:16 +0000
committerLibravatar GitHub <noreply@github.com>2024-04-29 09:18:16 +0000
commit1375a86919b7a47de14b3d99cb4e389158d6c94d (patch)
tree9017301dda253cf023df1ef747770aa606b967ba /vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go
parent[chore]: Bump go.opentelemetry.io/otel/sdk from 1.25.0 to 1.26.0 (#2879) (diff)
downloadgotosocial-1375a86919b7a47de14b3d99cb4e389158d6c94d.tar.xz
[chore]: Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc (#2878)
Diffstat (limited to 'vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go')
-rw-r--r--vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go
index 19d9d37ff..9005d6a0b 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/fieldmask.go
@@ -41,7 +41,7 @@ func FieldMaskFromRequestBody(r io.Reader, msg proto.Message) (*field_mask.Field
m, ok := item.node.(map[string]interface{})
switch {
- case ok:
+ case ok && len(m) > 0:
// if the item is an object, then enqueue all of its children
for k, v := range m {
if item.msg == nil {
@@ -96,6 +96,8 @@ func FieldMaskFromRequestBody(r io.Reader, msg proto.Message) (*field_mask.Field
queue = append(queue, child)
}
}
+ case ok && len(m) == 0:
+ fallthrough
case len(item.path) > 0:
// otherwise, it's a leaf node so print its path
fm.Paths = append(fm.Paths, item.path)