You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
required check disagrees with decoding on key casing and repeated values #103
The required check matches keys differently from the decoder, so a required field can be reported empty although it was decoded, or pass although it decoded to an empty value. Both came up in #100 and exist on main for every field type; map fields from #100 inherit them.
Fields match case-insensitively, required keys only case-sensitively.
Input
Decoded
Error
X=v
X: "v"
x is empty
PHONE.number=1
Phone.Number: "1"
phone is empty
DecodeValues behaves the same. directlyProvided probes src.lookup(path) and markProvidedByNestedKey probes info.requiredPrefixes[key[:off]], both exact, while the decoder resolves the field through the lowercased alias.
2. Repeated values
A scalar field takes the last of several values, but isEmpty checks value[0].
Input
Decoded
Error
x=&x=set
X: "set"
x is empty
x=set&x=
X: ""
none
The second case lets a required field through empty. isEmpty should check the last value for the scalar kinds.
Notes
The required check should stay allocation-free on the decode path; the existing benchmarks should stay flat.
Activity