3#ifndef OCPP_COMMON_SCHEMAS_HPP
4#define OCPP_COMMON_SCHEMAS_HPP
11#include <everest/logging.hpp>
12#include <nlohmann/json-schema.hpp>
13#include <nlohmann/json_fwd.hpp>
14#include <ocpp/common/support_older_cpp_versions.hpp>
16using json = nlohmann::json;
17using json_uri = nlohmann::json_uri;
18using json_validator = nlohmann::json_schema::json_validator;
26 std::shared_ptr<json_validator> validator;
27 fs::path schemas_path;
28 std::set<fs::path> available_schemas_paths;
29 const static std::vector<std::string> profiles;
30 const static std::regex date_time_regex;
33 void load_root_schema();
36 void loader(
const json_uri& uri, json& schema);
40 explicit Schemas(fs::path schemas_path);
42 explicit Schemas(
const json& schema_in);
44 explicit Schemas(json&& schema_in);
55 static void format_checker(
const std::string& format,
const std::string& value);
Contains the json schema validation for the libocpp config.
Definition: schemas.hpp:23
Schemas(fs::path schemas_path)
Creates a new Schemas object looking for the root schema file in relation to the provided main_dir.
Definition: schemas.cpp:12
static void format_checker(const std::string &format, const std::string &value)
Provides a format checker for the given format and value.
Definition: schemas.cpp:85
json get_schema()
Provides the config schema.
Definition: schemas.cpp:56
std::shared_ptr< json_validator > get_validator()
Provides the config schema validator.
Definition: schemas.cpp:60