Repository navigation
Add opt-in rfl::NoDuplicateKeys processor for YAML duplicate mapping keys - #44
Closed
clockblocker wants to merge 1 commit into
Closed
clockblocker wants to merge 1 commit into
clockblocker wants to merge 1 commit into
Conversation
This was referenced Nov 25, 2026
clockblocker
force-pushed
the
yaml-no-duplicate-keys
branch
from
November 25, 2026 11:39
002eeac to
0c3de12
Compare
clockblocker
force-pushed
the
yaml-sequence-error-aggregation
branch
from
November 25, 2026 11:39
af788eb to
0278569
Compare
clockblocker
force-pushed
the
yaml-no-duplicate-keys
branch
from
November 25, 2026 12:06
0c3de12 to
b9cb6df
Compare
clockblocker
force-pushed
the
yaml-sequence-error-aggregation
branch
from
November 25, 2026 12:06
0278569 to
b6856f7
Compare
clockblocker
changed the base branch from
yaml-sequence-error-aggregation
to
wave-base-14
November 25, 2026 12:07
clockblocker
force-pushed
the
yaml-no-duplicate-keys
branch
from
November 25, 2026 12:08
b9cb6df to
d36fcc0
Compare
…keys Keep existing default duplicate-key behavior intact for backwards compatibility, and add an opt-in rfl::NoDuplicateKeys processor (matching rfl::NoExtraFields and rfl::EnumNamesOnly). When rfl::NoDuplicateKeys is passed, rfl::yaml::Reader::read_object tracks seen keys per mapping and reports each repeated key as "Duplicate key '<k>'." at the repeated key's source location, aggregated alongside other field errors via add_error() (and honoring rfl::FailFast).
clockblocker
force-pushed
the
yaml-no-duplicate-keys
branch
from
November 25, 2026 12:10
d36fcc0 to
e8c7337
Compare
clockblocker
force-pushed
the
wave-base-14
branch
from
November 25, 2026 12:10
b6856f7 to
930c3db
Compare
Owner
Author
|
Branch is preserved on |
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.
Part 3 of 4 (split from #40; stacked on #43).
Summary
rfl::NoDuplicateKeysprocessor (include/rfl/NoDuplicateKeys.hpp,include/rfl/internal/no_duplicate_keys_v.hpp), matchingrfl::NoExtraFieldsandrfl::EnumNamesOnly.reader_supports_no_duplicate_keys_v<R>(static_assertinParser::read,ViewReader,ViewReaderWithDefault,MapReader, andFieldVariantReader) so passingrfl::NoDuplicateKeysto a reader that does not implement duplicate-key detection fails at compile time rather than silently succeeding.rfl::NoDuplicateKeysis passed torfl::yaml::read,rfl::yaml::Reader::read_objectrejects repeated mapping keys withDuplicate key '<k>'.at the repeated key's source location, aggregated alongside other field errors viaadd_error()(and honoringrfl::FailFast).rfl::NoDuplicateKeysindocs/content/processors.mdanddocs/content/supported_formats/yaml.md, and adds tests intests/yaml/test_no_duplicate_keys.cpp.Verification
rfl::json::read<S, rfl::NoDuplicateKeys>fails to compile withrfl::NoDuplicateKeys is not supported by this reader.