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
config: misplaced known YAML keys are silently dropped on main (v2.3.4 rejected them) #562
On main (v3 line), a config key that exists somewhere in the schema but not at the location used is silently accepted and dropped. v2.3.4 rejected these configs at startup via yaml KnownFields(true).
Repro
dashboard:
adminAllowLocalhost: true # dashboard: only valid inside preset templateslog:
level: infoproxyAccessLog: true # proxyAccessLog: is a top-level field
v2.3.4 (expected behavior): refuses to boot —
line 22: field dashboard not found in type config.config
line 28: field proxyAccessLog not found in type config.LogConfig
main: boots fine, both settings silently ignored. adminAllowLocalhost can appear enabled while actually doing nothing — arguably worse than a boot failure.
Root cause
processStructField (internal/config/keynormalizer.go) looks keys up in a flat, schema-wide canonical map (keyLookup.canonical). Misplaced keys pass the flat lookup, fail the path-aware fieldTypeByCanonical(typ, canonical), and hit a bare return:
The final root.Decode(out) is a plain yaml.Unmarshal (no KnownFields), so the surviving unknown key is ignored by decode too.
Impact
Real-world instance: our own getting-started docs shipped exactly this block (dashboard: section + proxyAccessLog under log:) — see #559 / PR #561. Any user migrating a v2 config by editing it runs into silent no-ops instead of errors.
Proposed fix
Report such keys as unknown-field issues (same shape as truly unknown keys: line/column + suggestions scoped to the struct expected at that location).
Activity