Skip to content

Reject duplicate YAML keys in data contracts - #1741

Merged
jschoedl merged 7 commits into
datacontract:mainfrom
kamathramu87:fix/reject-duplicate-contract-yaml-keys
Oct 19, 2026
Merged

jschoedl merged 7 commits into
datacontract:mainfrom
kamathramu87:fix/reject-duplicate-contract-yaml-keys

Conversation

@kamathramu87

Copy link
Copy Markdown
Contributor

Duplicate YAML mapping keys currently overwrite earlier values silently, so a repeated required, quality, or contract identity field can change what gets validated. Reject duplicate explicit keys with source/line diagnostics while preserving YAML merge overrides and date strings.

Validation: 48 relevant tests pass; Ruff lint and format checks pass.

@kamathramu87
kamathramu87 marked this pull request as ready for review October 13, 2026 08:44
…/reject-duplicate-contract-yaml-keys

# Conflicts:
#	CHANGELOG.md
The error's first location used to be the start of the enclosing mapping,
often line 1 of the contract. It now names the key and the line where it
first appears, followed by the duplicate.
@jschoedl

Copy link
Copy Markdown
Collaborator

Thank you for the PR! I applied some minor changes, otherwise LGTM :)

@jschoedl
jschoedl merged commit 8af7a70 into datacontract:main Oct 19, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants