Source

ocaml-bitbucket / api.ml

Diff from to

File api.ml

 open Common
-open Json_wrap
+open Tiny_json
+open Json_conv
 open Meta_conv.Conv
-open Json_conv
 open Sexplib.Conv
 
 module Json = struct
-  include Json_wrap.Json
-  let sexp_of_t j = Sexplib.Sexp.Atom (Json_io.string_of_json j)
+  include Json
+  let sexp_of_t j = Sexplib.Sexp.Atom (Json.show j)
   let t_of_sexp = function
-    | Sexplib.Sexp.Atom s -> Json_io.json_of_string s
+    | Sexplib.Sexp.Atom s -> Json.parse s
     | _ -> assert false
 end
 
     and resp = repo list with conv(json)
 
     let get ~user ~password = 
-      resp_of_json (Json_io.json_of_string (Curl.get_string (fun h ->
+      resp_of_json (Json.parse (Curl.get_string (fun h ->
         h#set_url "https://api.bitbucket.org/1.0/user/repositories/";
         h#set_userpwd (Printf.sprintf "%s:%s" user password))))
   end
       h#set_url "https://api.bitbucket.org/1.0/user";
       h#set_userpwd (Printf.sprintf "%s:%s" user password))
     in
-    try resp_of_json_exn (Json_io.json_of_string s) with e -> 
+    try resp_of_json_exn (Json.parse s) with e -> 
       prerr_endline (Printexc.to_string e);
       prerr_endline s;
       raise e