Refactor metadata returned by Readings property

Reading metadata is now JSON containg SensorDbusPath and SensorRedfishUri.
It is returned only if JSON metadata was provided during Report creation,
otherwise old behavior is maintained.

Additionally, json.hpp was removed as LabeledTupple is now used for
serialization and deserialization of metric and reading metadata.

Testing done:
- Unit test is passing as metric is returning proper metadata.
- Redfish get on redfish/v1/TelemetryService/MetricReports is containing
  MetricDefinition property, which utilizes SensorDbusPath metadata..
  Done on custom version of bmcweb.

Change-Id: I1b2cc4440d03e0fe45151b630f4e439839ed8589
Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
diff --git a/src/utils/json.hpp b/src/utils/json.hpp
deleted file mode 100644
index 2ae606f..0000000
--- a/src/utils/json.hpp
+++ /dev/null
@@ -1,63 +0,0 @@
-#pragma once
-
-#include <nlohmann/json.hpp>
-
-#include <string_view>
-
-namespace utils
-{
-
-template <class T>
-struct is_vector : std::false_type
-{};
-
-template <class T>
-struct is_vector<std::vector<T>> : std::true_type
-{};
-
-template <class T>
-constexpr bool is_vector_v = is_vector<T>::value;
-
-template <class T>
-std::optional<T> readJson(const nlohmann::json& json)
-{
-    if constexpr (is_vector_v<T>)
-    {
-        if (json.is_array())
-        {
-            auto result = T{};
-            for (const auto& item : json.items())
-            {
-                if (auto val = readJson<typename T::value_type>(item.value()))
-                {
-                    result.emplace_back(*val);
-                }
-            }
-            return result;
-        }
-    }
-    else
-    {
-        if (const T* val = json.get_ptr<const T*>())
-        {
-            return *val;
-        }
-    }
-
-    return std::nullopt;
-}
-
-template <class T>
-std::optional<T> readJson(const nlohmann::json& json, std::string_view key)
-{
-    auto it = json.find(key);
-    if (it != json.end())
-    {
-        const nlohmann::json& subJson = *it;
-        return readJson<T>(subJson);
-    }
-
-    return std::nullopt;
-}
-
-} // namespace utils
diff --git a/src/utils/labeled_tuple.hpp b/src/utils/labeled_tuple.hpp
index a224141..398e4be 100644
--- a/src/utils/labeled_tuple.hpp
+++ b/src/utils/labeled_tuple.hpp
@@ -81,6 +81,11 @@
         from_json_all(j, std::make_index_sequence<sizeof...(Args)>());
     }
 
+    std::string dump() const
+    {
+        return to_json().dump();
+    }
+
     template <size_t Idx>
     const auto& at_index() const
     {
diff --git a/src/utils/tstring.hpp b/src/utils/tstring.hpp
index 8f9701a..f0bc679 100644
--- a/src/utils/tstring.hpp
+++ b/src/utils/tstring.hpp
@@ -128,5 +128,29 @@
     }
 };
 
+struct MetricProperties
+{
+    static std::string str()
+    {
+        return "MetricProperties";
+    }
+};
+
+struct SensorDbusPath
+{
+    static std::string str()
+    {
+        return "SensorDbusPath";
+    }
+};
+
+struct SensorRedfishUri
+{
+    static std::string str()
+    {
+        return "SensorRedfishUri";
+    }
+};
+
 } // namespace tstring
 } // namespace utils