8#include <userver/compiler/demangle.hpp>
9#include <userver/formats/json/value.hpp>
11USERVER_NAMESPACE_BEGIN
15[[
noreturn]]
void ThrowInvalidSecdistType(
const formats::json::
Value& val, std::string_view type);
17std::string GetString(
const formats::json::
Value& parent_val, std::string_view name);
19int GetInt(
const formats::json::
Value& parent_val, std::string_view name,
int dflt);
22T GetValue(
const formats::json::
Value& parent_val, std::string_view key,
const T& dflt) {
23 const auto& val = parent_val
[key
];
25 return val.
template As<T>(dflt);
27 ThrowInvalidSecdistType(val,
compiler::GetTypeName<T>());
31void CheckIsObject(
const formats::json::
Value& val, std::string_view name);
33void CheckIsArray(
const formats::json::
Value& val, std::string_view name);