Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
rpc::meta::ValidateArrayAt Class Referencefinal

A meta-processor that specifies a list of specs to run against the object at the given index in the array. More...

#include <MetaProcessors.hpp>

Public Member Functions

 ValidateArrayAt (std::size_t idx, std::initializer_list< FieldSpec > specs)
 Constructs a processor that validates the specified element of a JSON array.
 
MaybeError verify (boost::json::value &value, std::string_view key) const
 Verify that the JSON array element at given index is valid according the stored specs.
 

Detailed Description

A meta-processor that specifies a list of specs to run against the object at the given index in the array.

Constructor & Destructor Documentation

◆ ValidateArrayAt()

rpc::meta::ValidateArrayAt::ValidateArrayAt ( std::size_t idx,
std::initializer_list< FieldSpec > specs )
inline

Constructs a processor that validates the specified element of a JSON array.

Parameters
idxThe index inside the array to validate
specsThe specifications to validate against

Member Function Documentation

◆ verify()

MaybeError rpc::meta::ValidateArrayAt::verify ( boost::json::value & value,
std::string_view key ) const
nodiscard

Verify that the JSON array element at given index is valid according the stored specs.

Parameters
valueThe JSON value representing the outer object
keyThe key used to retrieve the array from the outer object
Returns
Possibly an error

The documentation for this class was generated from the following files: