4#include <nlohmann/json.hpp>
13const nlohmann::json * get(
const nlohmann::json & map,
const std::string &
key);
15nlohmann::json * get(nlohmann::json & map,
const std::string &
key);
23const nlohmann::json & valueAt(
24 const nlohmann::json::object_t & map,
25 const std::string &
key);
27std::optional<nlohmann::json> optionalValueAt(
const nlohmann::json::object_t &
value,
const std::string &
key);
33const nlohmann::json * getNullable(
const nlohmann::json &
value);
34const nlohmann::json::object_t & getObject(
const nlohmann::json &
value);
35const nlohmann::json::array_t & getArray(
const nlohmann::json &
value);
36const nlohmann::json::string_t & getString(
const nlohmann::json &
value);
37const nlohmann::json::number_integer_t & getInteger(
const nlohmann::json &
value);
38const nlohmann::json::boolean_t & getBoolean(
const nlohmann::json &
value);
39Strings getStringList(
const nlohmann::json &
value);
40StringMap getStringMap(
const nlohmann::json &
value);
41StringSet getStringSet(
const nlohmann::json &
value);
72template<
typename K,
typename V>
94struct adl_serializer<std::optional<T>>
100 static void from_json(
const json & json, std::optional<T> &
t)
104 "null is already in use for underlying type's JSON");
107 : std::make_optional(json.template get<T>());
114 static void to_json(json & json,
const std::optional<T> &
t)
118 "null is already in use for underlying type's JSON");
ExperimentalFeature
Definition experimental-features.hh:19
const T::key_type & key
Definition lexer.l:2763
T t
Definition lexer.l:154
const T & value
Definition lexer.l:492
Definition json-utils.hh:55
static void to_json(json &json, const std::optional< T > &t)
Convert an optional type to a JSON type treating std::nullopt as null.
Definition json-utils.hh:114
static void from_json(const json &json, std::optional< T > &t)
Convert a JSON type to an optional<T> treating null as std::nullopt.
Definition json-utils.hh:100