mirror of
https://github.com/ModernRelay/omnigraph.git
synced 2026-06-09 01:35:18 +02:00
`#[serde(deny_unknown_fields)]` was applied unconditionally as a struct attribute, so the `version` discriminator did not actually gate strictness: a legacy (no-`version:`) config was wrongly rejected for any unrecognized key, contradicting the documented contract (RFC-002 §3: no version = legacy-lenient, `version: 1` = strict) and the code's own comments. Make strictness a function of `version`, decided at one point in `load_config_in`: parse once via `serde_ignored` (collecting ignored fields at all depths), then reject unknowns only under `version: 1`; legacy tolerates them (restoring the pre-existing behavior). Drop `deny_unknown_fields` from the two legacy-spanning structs (`OmnigraphConfig`, `TargetConfig`) and keep it on the v1-only typed blocks (`StorageBlock`, `ServerEntry`), which have no legacy form. This removes the double-parse (`check_config_version` is gone — the version is read from the parsed struct) and makes v1 strictness comprehensive: a misspelled nested key (e.g. under `cli:`) now errors instead of being silently dropped. Turns the previous commit's regression test green and pins v1 comprehensive strictness. |
||
|---|---|---|
| .. | ||
| omnigraph | ||
| omnigraph-api-types | ||
| omnigraph-cli | ||
| omnigraph-compiler | ||
| omnigraph-config | ||
| omnigraph-policy | ||
| omnigraph-queries | ||
| omnigraph-server | ||