#pragma once

#include "http/http_request.hpp"
#include "logging.hpp"

#include <boost/algorithm/string/predicate.hpp>
#include <nlohmann/json.hpp>

#include <string_view>

enum class JsonParseResult
{
    BadContentType,
    BadJsonData,
    Success,
};

inline JsonParseResult parseRequestAsJson(const crow::Request& req,
                                          nlohmann::json& jsonOut)
{
    std::string_view contentType =
        req.getHeaderValue(boost::beast::http::field::content_type);

    if (!boost::iequals(contentType, "application/json") &&
        !boost::iequals(contentType, "application/json; charset=utf-8"))
    {
        BMCWEB_LOG_WARNING << "Failed to parse content type on request";
#ifndef BMCWEB_INSECURE_IGNORE_CONTENT_TYPE
        return JsonParseResult::BadContentType;
#endif
    }
    jsonOut = nlohmann::json::parse(req.body, nullptr, false);
    if (jsonOut.is_discarded())
    {
        BMCWEB_LOG_WARNING << "Failed to parse json in request";
        return JsonParseResult::BadJsonData;
    }

    return JsonParseResult::Success;
}
