summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2017-01-10 03:50:28 +0700
committerDaniil Baturin <daniil@baturin.org>2017-01-10 03:50:28 +0700
commitf947b3e8e7b9db2fcab250ce6d8050b650130cec (patch)
tree3f69a45fa9336c1c8a743c3080c6656ac19a5e2b /src
parent6cb2c8f1c67532f1f3a23e75b80984d40ed160d2 (diff)
downloadvyconf-f947b3e8e7b9db2fcab250ce6d8050b650130cec.tar.gz
vyconf-f947b3e8e7b9db2fcab250ce6d8050b650130cec.zip
Add JSON de/serialization derivers to vytree and config tree modules.
Diffstat (limited to 'src')
-rw-r--r--src/config_tree.ml4
-rw-r--r--src/config_tree.mli4
-rw-r--r--src/vytree.ml2
-rw-r--r--src/vytree.mli2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/config_tree.ml b/src/config_tree.ml
index f99c737..538b258 100644
--- a/src/config_tree.ml
+++ b/src/config_tree.ml
@@ -10,9 +10,9 @@ type config_node_data = {
comment: string option;
inactive: bool;
ephemeral: bool;
-}
+} [@@deriving yojson]
-type t = config_node_data Vytree.t
+type t = config_node_data Vytree.t [@@deriving yojson]
let default_data = {
values = [];
diff --git a/src/config_tree.mli b/src/config_tree.mli
index 2c463cb..4da734e 100644
--- a/src/config_tree.mli
+++ b/src/config_tree.mli
@@ -8,9 +8,9 @@ type config_node_data = {
comment : string option;
inactive : bool;
ephemeral : bool;
-}
+} [@@deriving yojson]
-type t = config_node_data Vytree.t
+type t = config_node_data Vytree.t [@@deriving yojson]
val default_data : config_node_data
diff --git a/src/vytree.ml b/src/vytree.ml
index b27aea6..74dbe45 100644
--- a/src/vytree.ml
+++ b/src/vytree.ml
@@ -2,7 +2,7 @@ type 'a t = {
name: string;
data: 'a;
children: 'a t list
-}
+} [@@deriving yojson]
type position = Before of string | After of string | End | Default
diff --git a/src/vytree.mli b/src/vytree.mli
index d00d3ff..02d8edf 100644
--- a/src/vytree.mli
+++ b/src/vytree.mli
@@ -1,4 +1,4 @@
-type 'a t
+type 'a t [@@deriving yojson]
exception Empty_path
exception Duplicate_child