#ifndef DOUWCO_HIVEMIND_JSON_TOOLS_HPP #define DOUWCO_HIVEMIND_JSON_TOOLS_HPP #include #include namespace DouwcoHivemind { template std::vector jsonToVector(const nlohmann::json &json) { std::vector vector; for (const auto &item : json) { vector.emplace_back(item.get()); } return vector; }; template nlohmann::json vectorToJson(const std::vector &vector) { nlohmann::json json; for (const auto &item : vector) { json.emplace_back(item); } return json; }; } #endif // DOUWCO_HIVEMIND_JSON_TOOLS_HPP