From 647eace02ed8dac46e75452898c3470f82576818 Mon Sep 17 00:00:00 2001
From: Allan Blanchard <allan.blanchard@cea.fr>
Date: Wed, 3 May 2023 17:33:11 +0200
Subject: [PATCH] [libs] fixes Yojson 2.1 support

---
 src/libraries/utils/json.mll | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/libraries/utils/json.mll b/src/libraries/utils/json.mll
index 47dfb1329c2..2017df4f369 100644
--- a/src/libraries/utils/json.mll
+++ b/src/libraries/utils/json.mll
@@ -334,7 +334,6 @@ let rec merge_assoc_lists la lb =
   List.rev r
 
 let merge_object path json_root_obj =
-  let open Yojson.Basic.Util in
   let existing_root_obj =
     try
       match Hashtbl.find json_tbl path with
@@ -343,14 +342,13 @@ let merge_object path json_root_obj =
     with Not_found ->
       `Assoc []
   in
-  let existing_assoc = existing_root_obj |> to_assoc in
-  let new_assoc = json_root_obj |> to_assoc in
+  let existing_assoc = existing_root_obj |> Yojson.Basic.Util.to_assoc in
+  let new_assoc = json_root_obj |> Yojson.Basic.Util.to_assoc in
   let merged = merge_assoc_lists existing_assoc new_assoc in
   let merged_obj = `Assoc merged in
   Hashtbl.replace json_tbl path merged_obj
 
 let merge_array path json_root_array =
-  let open Yojson.Basic.Util in
   let existing_root_array =
     try
       match Hashtbl.find json_tbl path with
@@ -359,8 +357,8 @@ let merge_array path json_root_array =
     with Not_found ->
       `List []
   in
-  let existing_list = existing_root_array |> to_list in
-  let new_list = json_root_array |> to_list in
+  let existing_list = existing_root_array |> Yojson.Basic.Util.to_list in
+  let new_list = json_root_array |> Yojson.Basic.Util.to_list in
   let merged_list = `List (existing_list @ new_list) in
   Hashtbl.replace json_tbl path merged_list
 
-- 
GitLab