![]() |
boost::taar::jsonrpc::parse_envelope — Parse a JSON value as a JSON-RPC 2.0 request envelope.
// In header: <boost/taar/jsonrpc/envelope.hpp> boost::system::result< envelope > parse_envelope(boost::json::value const & value);
Validates the spec's required structure: value must be a JSON object, must contain a "jsonrpc" string equal to "2.0", and must contain a "method" string. The "id" and "params" fields are copied into the result when present and left empty otherwise.
Batch requests (top-level arrays of envelopes) are not handled here. jsonrpc::endpoint iterates a parsed array and invokes this function per element; per the specification, an empty batch is reported as a single invalid_request response.
Returns: |
A populated envelope on success, or |