This should resolve #106. It adds an on_duplicate_type function to formats_builder which takes a duplicate_type_action as a parameter. The formats object functions register_extractor, register_serializer, and register_adapter were also updated to accept a duplicate_type_action. The valid actions are:
duplicate_type_action::ignore -- Ignores any duplicate types, and does not change the existing serializers and extractors.
duplicate_type_action::replace -- Ignores any duplicate types, and replaces the existing serializer or extractor.
duplicate_type_action::exception -- Throws an exception. A new duplicate_type_error exception was created to distinguish this type of error from other errors.
A unit test was added to test this functionality, and the serialization builder DSL documentation was updated with the new interface.
This should resolve #106. It adds an
on_duplicate_type
function toformats_builder
which takes aduplicate_type_action
as a parameter. Theformats
object functionsregister_extractor
,register_serializer
, andregister_adapter
were also updated to accept aduplicate_type_action
. The valid actions are:duplicate_type_action::ignore
-- Ignores any duplicate types, and does not change the existing serializers and extractors.duplicate_type_action::replace
-- Ignores any duplicate types, and replaces the existing serializer or extractor.duplicate_type_action::exception
-- Throws an exception. A newduplicate_type_error
exception was created to distinguish this type of error from other errors.A unit test was added to test this functionality, and the serialization builder DSL documentation was updated with the new interface.