Validates that the value is one of the values passed in.
More...
#include <Validators.hpp>
|
| OneOf (std::initializer_list< Type > options) |
| Construct the validator with stored options of initializer list.
|
|
template<typename InputIt > |
| OneOf (InputIt begin, InputIt end) |
| Construct the validator with stored options of other container.
|
|
MaybeError | verify (boost::json::value const &value, std::string_view key) const |
| Verify that the JSON value is one of the stored options.
|
|
template<typename
Type>
class rpc::validation::OneOf< Type >
Validates that the value is one of the values passed in.
◆ OneOf() [1/2]
Construct the validator with stored options of initializer list.
- Parameters
-
options | The list of allowed options |
◆ OneOf() [2/2]
template<typename InputIt >
Construct the validator with stored options of other container.
- Parameters
-
begin,end | the range to copy the elements from |
◆ verify()
Verify that the JSON value is one of the stored options.
- Parameters
-
value | The JSON value representing the outer object |
key | The 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 class was generated from the following file: