Function doCustomValidations

Synopsis

#include <orm_lib/inc/drogon/orm/RestfulController.h>

bool doCustomValidations(const Json::Value &pJson, std::string &err)

Description

No description yet.

Source

Lines 140-153 in orm_lib/inc/drogon/orm/RestfulController.h.

bool doCustomValidations(const Json::Value &pJson, std::string &err)
{
    for (auto &validator : validators_)
    {
        if (pJson.isMember(validator.first))
        {
            if (!validator.second(pJson[validator.first], err))
            {
                return false;
            }
        }
    }
    return true;
}





Add Discussion as Guest

Log in to DocsForge