summaryrefslogtreecommitdiff
path: root/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2025-03-10 09:23:45 +0000
committerLibravatar GitHub <noreply@github.com>2025-03-10 09:23:45 +0000
commit252a17a691a316af8a1b0d960436c32257b4f66b (patch)
tree3768a2a373f3a0e462b33ef389e30ce761dce5cb /vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go
parent[chore]: Bump github.com/prometheus/client_golang from 1.21.0 to 1.21.1 (#3890) (diff)
downloadgotosocial-252a17a691a316af8a1b0d960436c32257b4f66b.tar.xz
[chore]: Bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc (#3888)
Diffstat (limited to 'vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go')
-rw-r--r--vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go
index 0a1ca7e06..8549dfb97 100644
--- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go
+++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/query.go
@@ -126,6 +126,15 @@ func populateFieldValueFromPath(msgValue protoreflect.Message, fieldPath []strin
}
}
+ // Check if oneof already set
+ if of := fieldDescriptor.ContainingOneof(); of != nil && !of.IsSynthetic() {
+ if f := msgValue.WhichOneof(of); f != nil {
+ if fieldDescriptor.Message() == nil || fieldDescriptor.FullName() != f.FullName() {
+ return fmt.Errorf("field already set for oneof %q", of.FullName().Name())
+ }
+ }
+ }
+
// If this is the last element, we're done
if i == len(fieldPath)-1 {
break
@@ -140,13 +149,6 @@ func populateFieldValueFromPath(msgValue protoreflect.Message, fieldPath []strin
msgValue = msgValue.Mutable(fieldDescriptor).Message()
}
- // Check if oneof already set
- if of := fieldDescriptor.ContainingOneof(); of != nil && !of.IsSynthetic() {
- if f := msgValue.WhichOneof(of); f != nil {
- return fmt.Errorf("field already set for oneof %q", of.FullName().Name())
- }
- }
-
switch {
case fieldDescriptor.IsList():
return populateRepeatedField(fieldDescriptor, msgValue.Mutable(fieldDescriptor).List(), values)