Repository navigation
Allow rfl::Rename to share wire name with skipped fields (#427) - #77
Closed
clockblocker wants to merge 2 commits into
Closed
clockblocker wants to merge 2 commits into
clockblocker wants to merge 2 commits into
Conversation
Owner
Author
|
Signed-off branch is preserved on |
3 of 16 tasks
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.
Summary
Allows
rfl::Rename<"name", ...>to share a wire name with anrfl::Skipped field (or complementaryrfl::SkipSerialization/rfl::SkipDeserializationfields) without triggering false duplicate field-name errors, while still rejecting genuine duplicate serialized or deserialized wire names.Fixes munich-data-engineering#427
Details
skip_traits<T>(is_skip.hpp) andrename_traits<T>(is_rename.hpp) acrosscpp20/cpp26field name extraction and case-transform processors so bothRename<"items", SkipDeserialization<T>>andSkipDeserialization<Rename<"items", T>>resolve cleanly.no_duplicate_field_names<Fields>()to a singleconstexprstd::arraypass checking direction-aware collisions (conflict iff both fields are serialized or both are deserialized) and enforced it onrfl::NamedTuple.find_index(find_matching_field_index) andNamedTuple/move_from_named_tuplesorfl::to_named_tuple/rfl::from_named_tuple/ cross-type conversions disambiguate shared wire names by(skip_serialization, skip_deserialization)and flattened positional offsets.NamedTupleParser::writeto pass the exact count of serialized fields (num_serialized_fields) toParentType::add_object(preventing MessagePack / strict-size writer wire corruption).rfl::env::Reader::read_objectto iterateViewType::Fieldsskippingskip_deserialization_vfields (preventing duplicate reads of shared wire names).NamedTupleParser::add_field_to_schemato gate on!skip_serialization_v(note: standaloneSkipDeserialization<T>fields now appear in schemas since they are serialized on the wire).Verification
ctestsuite (json,generic,cli,env,json_c_arrays_and_inheritance) under-Wall -Werror: 595/595 PASSED (includingStrictCountingWriterMessagePack count tests,tests/env/test_rename_skip.cpp, andfrom_named_tupleround-trip tests).-fsyntax-only): all 6 genuine duplicate / ambiguous negative cases fail cleanly withstatic_assert.