Skip to content

Commit

Permalink
fix: exclude synthetic oneofs during populateFieldValueFromPath
Browse files Browse the repository at this point in the history
  • Loading branch information
aerialls committed Dec 17, 2024
1 parent c670ef5 commit b4f4142
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func populateFieldValueFromPath(msgValue protoreflect.Message, fieldPath []strin
}

// Check if oneof already set
if of := fieldDescriptor.ContainingOneof(); of != nil {
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())
}
Expand Down

0 comments on commit b4f4142

Please sign in to comment.