Source

ocaml-bitbucket / api.ml

Diff from to
 open Common
 open Json_wrap
+open Meta_conv.Conv
 open Json_conv
 open Sexplib.Conv
 
     | _ -> assert false
 end
 
+module Address = struct
+  include Address
+  let sexp_of_t _ = Sexplib.Sexp.Atom ""
+  let t_of_sexp _ = top
+end
+
+type 'target fields = (string * ('target * Address.t)) list with sexp
+
 module Scheme = struct
   type t = Hg(:"hg":) | Git(:"git":) with conv(json)
 end
 
   type resp = {
     user : user;
-    rest (: Rest_in_raw :) : (string * Json.t) list
+    rest (: Rest_in_raw :) : Json.t fields;
   } with conv(json), sexp
 
   let get ~user ~password = 
       h#set_url "https://api.bitbucket.org/1.0/user";
       h#set_userpwd (Printf.sprintf "%s:%s" user password))
     in
-    try resp_of_json (Json_io.json_of_string s) with e -> 
+    try resp_of_json_exn (Json_io.json_of_string s) with e -> 
       prerr_endline (Printexc.to_string e);
       prerr_endline s;
       raise e