aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/experimental-features.hh
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-06-16 15:19:14 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-06-18 23:31:10 -0400
commitc8825e9d8c3fa802811f3829d055e3ef9aae90e2 (patch)
tree590b8bf2103bb7e09d2fb72c930fe5542ee3d36d /src/libutil/experimental-features.hh
parent3b0d8fd796336318ce03c8ee90cd40ebb65fb032 (diff)
Create nlohmann serializers for `std::optional` and use
This is somewhat tricky.
Diffstat (limited to 'src/libutil/experimental-features.hh')
-rw-r--r--src/libutil/experimental-features.hh8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libutil/experimental-features.hh b/src/libutil/experimental-features.hh
index 892c6c371..15ff5e0cd 100644
--- a/src/libutil/experimental-features.hh
+++ b/src/libutil/experimental-features.hh
@@ -3,7 +3,7 @@
#include "comparator.hh"
#include "error.hh"
-#include "nlohmann/json_fwd.hpp"
+#include "json-utils.hh"
#include "types.hh"
namespace nix {
@@ -93,4 +93,10 @@ public:
void to_json(nlohmann::json &, const ExperimentalFeature &);
void from_json(const nlohmann::json &, ExperimentalFeature &);
+/**
+ * It is always rendered as a string
+ */
+template<>
+struct json_avoids_null<ExperimentalFeature> : std::true_type {};
+
}