9#ifndef MANTISBASE_VALIDATORS_H
10#define MANTISBASE_VALIDATORS_H
16#include "nlohmann/json.hpp"
20 using json = nlohmann::json;
30 static std::optional<json>
findPreset(
const std::string &key);
33 static std::optional<std::string>
validatePreset(
const std::string &key,
const std::string &value);
71 static std::unordered_map<std::string, json> presets;
MantisBase entry point.
Definition mantisbase.h:54
Represents a database table/entity with schema and CRUD operations.
Definition entity.h:55
Static validators for schema definitions and CRUD request bodies.
Definition validators.h:27
static std::optional< json > findPreset(const std::string &key)
Definition validators.cpp:44
static std::optional< std::string > validateTableSchema(const json &entity_schema)
Definition validators.cpp:319
static std::optional< std::string > intPrecisionValueCheck(const json &field, const json &body)
Definition validators.cpp:76
static std::optional< std::string > maximumConstraintCheck(const json &field, const json &body)
Definition validators.cpp:141
static std::optional< std::string > validatePreset(const std::string &key, const std::string &value)
Definition validators.cpp:56
static std::optional< std::string > validatorConstraintCheck(const json &field, const json &body)
Definition validators.cpp:212
static std::optional< std::string > validateUpdateRequestBody(const MbEntity &entity, const json &body)
Definition validators.cpp:416
static std::optional< std::string > requiredConstraintCheck(const json &field, const json &body)
Definition validators.cpp:193
static std::optional< std::string > validateRequestBody(const MbEntity &entity, const json &body)
Definition validators.cpp:379
static std::optional< std::string > foreignKeyConstraintCheck(const MantisBase &app, const json &field, const json &body)
Validate a foreign-key field against a referenced entity record.
Definition validators.cpp:235
static std::optional< std::string > minimumConstraintCheck(const json &field, const json &body)
Definition validators.cpp:89
static std::optional< std::string > viewTypeSQLCheck(const json &body)
Definition validators.cpp:284
MbDatabase connection, pooling, and system table migration.
MbEntity class for database table operations and CRUD functionality.
#define MANTISBASE_API
Definition export.h:31
nlohmann::json json
Shorten JSON namespace.
Definition api_keys.h:36
Core type aliases, handler signatures, and the MbAppMixin DI mixin.