Preserve terminal values during result lookup

This commit is contained in:
2026-11-21 12:00:29 +00:00
parent bcee3f866f
commit ed5d57d061
4 changed files with 86 additions and 11 deletions

View File

@@ -4,9 +4,13 @@ import "reflect"
func (b *schemaBuilder) describeOrdinaryField(owner *typeDescriptor, field reflect.StructField, index int, name string, secret bool, path Path) *schemaIssue {
fieldPath := path.Key(name)
fieldType, issue := b.describe(field.Type, fieldPath)
if issue != nil {
return issue
var fieldType *typeDescriptor
if !b.lookup {
var issue *schemaIssue
fieldType, issue = b.describe(field.Type, fieldPath)
if issue != nil {
return issue
}
}
if issue := addField(owner, fieldDescriptor{name: name, index: []int{index}, descriptor: fieldType, secret: secret}, path); issue != nil {
return issue