json-voorhees icon indicating copy to clipboard operation
json-voorhees copied to clipboard

Type adapter `post_extract` should provide source JSON

Open tgockel opened this issue 4 years ago • 0 comments

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&)>.

tgockel avatar Oct 15 '19 21:10 tgockel