tgockel / json-voorhees

A killer modern C++ library for interacting with JSON.
http://tgockel.github.io/json-voorhees/
Apache License 2.0
128 stars 18 forks source link

Add option to ignore or replace duplicate adapter registrations. #113

Closed vexingcodes closed 6 years ago

vexingcodes commented 6 years ago

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:

A unit test was added to test this functionality, and the serialization builder DSL documentation was updated with the new interface.