json-voorhees
json-voorhees copied to clipboard
Type adapter `post_extract` should provide source JSON
The post_extract
function on serialization DSL adapters currently only takes the jsonv::extraction_context
and the extracted T
. If the post-extract function needs to do something like throw an exception, it is common to want to include the source JSON in the message. Since adapter_builder<T>::adapter_impl::create
has access to the source JSON anyway, this should be easy to provide.
adapter_builder<T>::post_extract_func
should be changed to std::function<T (const extraction_context&, T&&, const value&)>
.