Repository navigation
fix(check): report a mapping's type mismatch whatever its entries say - #6
Merged
adammharris merged 1 commit intoNov 11, 2026
Conversation
judge dropped a container's type mismatch whenever any descendant had reported one. That holds for a list, which a type admits when every item fits, so a list that does not fit has an item that has already said so. It does not hold for a mapping: no type admits one by its entries, so a mapping under a scalar type is wrong for its own reason. A mapping with a wrong entry then went unreported, and check disagreed with explain. The drop now applies to lists only. Closes docs/tasks/a-wrong-entry-hides-its-mappings-mismatch.md. Behavioural-change: Schema::check now reports a mapping's own type mismatch even when an entry beneath it also mismatches, so such a document gains a verdict at the mapping's path.
adammharris
deleted the
agent/backlog-a-wrong-entry-hides-its-mappings-mismatch
branch
November 11, 2026 17:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
judgeinsrc/check.rsdrops a container's own type mismatch in favour of its descendants' only when the container is a list. A mapping that does not fit its rule's type now reports its own mismatch whether or not an entry beneath it also mismatches.Why
The drop exists because a type admits a list whose every item fits (
FieldType::admits), so a list that does not fit has an item that has already reported at its own path. No type admits a mapping by its entries, so a mapping under a scalar type is wrong for its own reason. Applied to mappings, the drop hid the mapping's error as soon as any entry was also wrong, andcheckdisagreed withexplain.Behavioural change:
Schema::checkgains a verdict at a mapping's path in that case (recorded as aBehavioural-change:trailer on the commit).Closes
docs/tasks/a-wrong-entry-hides-its-mappings-mismatch.md(markedstatus: donein this branch).Verification
a_mappings_type_mismatch_is_reported_whatever_its_entries_saycovers both repros from the task (meta.**typedstr, and the root under**), plus a list under the same rule still reported once at its item. It failed before the fix and passes after.fig-schema check --schema m.yaml m2.yamlnow listsmeta.author: expected str, found intandmeta: expected str, found map, matchingexplain.ship ci: all 5 jobs pass (fmt, clippy-D warnings, test, doc, MSRV 1.88).