Make trigger use common types

Trigger having its own variant causes us to duplicate code.  This was
left out of the original refactoring because it was complex given
the variant of a variant status.

This commit finally does the port.

Tested: Unclear what tests exist for triggers that would use this code
```
curl  -k --user "root:0penBmc" -H "Content-Type: application/json" -X POST https://192.168.7.2/redfish/v1/TelemetryService/Triggers -d '{"Name": "eds", "NumericThresholds": {"LowerCritical": {"Reading": 1.0, "Activation": "Increasing", "DwellTime": "P1S"}}}'
```

Succeeds.  GET on the resource results in:
{
  "@odata.id": "/redfish/v1/TelemetryService/Triggers/eds",
  "@odata.type": "#Triggers.v1_2_0.Triggers",
  "Id": "eds",
  "Links": {
    "MetricReportDefinitions": []
  },
  "MetricProperties": [],
  "MetricType": "Numeric",
  "Name": "eds",
  "NumericThresholds": {
    "LowerCritical": {
      "Activation": "Increasing",
      "DwellTime": "PT1.000S",
      "Reading": 1.0
    }
  },
  "TriggerActions": []
}

Change-Id: I8f683cc9423ee2ba111d3ca1889e78f7d33433c9
Signed-off-by: Ed Tanous <etanous@nvidia.com>
diff --git a/include/openbmc_dbus_rest.hpp b/include/openbmc_dbus_rest.hpp
index 8a6830e..c35a2be 100644
--- a/include/openbmc_dbus_rest.hpp
+++ b/include/openbmc_dbus_rest.hpp
@@ -66,6 +66,19 @@
 #include <variant>
 #include <vector>
 
+namespace nlohmann
+{
+template <typename... Args>
+struct adl_serializer<std::variant<Args...>>
+{
+    // NOLINTNEXTLINE(readability-identifier-naming)
+    static void to_json(json& j, const std::variant<Args...>& args)
+    {
+        std::visit([&j](auto&& val) { j = val; }, args);
+    }
+};
+} // namespace nlohmann
+
 namespace crow
 {
 namespace openbmc_mapper
@@ -204,20 +217,8 @@
             for (const auto& [name, value] : propertiesList)
             {
                 nlohmann::json& propertyJson = objectJson[name];
-                std::visit(
-                    [&propertyJson](auto&& val) {
-                        if constexpr (std::is_same_v<
-                                          std::decay_t<decltype(val)>,
-                                          sdbusplus::message::unix_fd>)
-                        {
-                            propertyJson = val.fd;
-                        }
-                        else
-                        {
-                            propertyJson = val;
-                        }
-                    },
-                    value);
+                std::visit([&propertyJson](auto&& val) { propertyJson = val; },
+                           value);
             }
         });
 }