Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc::validation::Type< Types > Struct Template Referencefinal

Validates that the type of the value is one of the given types. More...

#include <Validators.hpp>

Public Member Functions

MaybeError verify (boost::json::value &value, std::string_view key) const
 Verify that the JSON value is (one) of specified type(s).

Detailed Description

template<typename... Types>
struct rpc::validation::Type< Types >

Validates that the type of the value is one of the given types.

Member Function Documentation

◆ verify()

template<typename... Types>
MaybeError rpc::validation::Type< Types >::verify ( boost::json::value & value,
std::string_view key ) const
inlinenodiscard

Verify that the JSON value is (one) of specified type(s).

Note
The value itself can only change for integral types and only if the value is outside of the range of the expected integer type (see checkTypeAndClamp).
Parameters
valueThe JSON value representing the outer object
keyThe key used to retrieve the tested value from the outer object
Returns
RippledError::rpcINVALID_PARAMS if validation failed; otherwise no error is returned

The documentation for this struct was generated from the following file: