@@ -13,7 +13,7 @@ module J = {
1313
1414open Infix ;
1515
16- type jsonrpc = Message ( float , string,Json . t) |Notification ( string,Json . t) ;
16+ type jsonrpc = Message ( Json . t , string,Json . t) |Notification ( string,Json . t) ;
1717
1818let readMessage = (log, input)=> {
1919let clength = input_line(input);
@@ -30,7 +30,7 @@ let readMessage = (log, input) => {
3030let json = try (Json . parse(raw)) {
3131| Failure (message )=> failwith ("Unable to parse message " ++ raw++ " as json: " ++ message)
3232 };
33- let id = Json . get("id" , json)|?> Json . number ;
33+ let id = Json . get("id" , json);
3434let method= Json . get("method" , json)|?> Json . string|! "method required" ;
3535let params = Json . get("params" , json)|! "params required" ;
3636switch id {
@@ -52,7 +52,7 @@ let sendMessage = (log, output, id, result) => {
5252open Json ;
5353open J ;
5454let content = Json . stringify(o([
55- ("id" , Number (id) ),
55+ ("id" , id ),
5656 ("jsonrpc" , s("2.0" )),
5757 ("result" , result)] ));
5858 log("Sending response " ++ content);
@@ -63,7 +63,7 @@ let sendError = (log, output, id, error) => {
6363open Json ;
6464open J ;
6565let content = Json . stringify(o([
66- ("id" , Number (id) ),
66+ ("id" , id ),
6767 ("jsonrpc" , s("2.0" )),
6868 ("error" , error)] ));
6969 log("Sending response " ++ content);