Skip to content

RESTful JSON API using Eliom example not working #13

@MikkelStorgaard

Description

@MikkelStorgaard

I'm on
Ocaml 4.07.1
ppx_deriving_yojson 3.5.1
ppx_deriving 4.4
yojson 1.7.0
eliom 6.7.0

It seems like ppx_deriving_yojson is generating an extra function with the name _, for the last of the derived types.
Am I doing something wrong?

trading_model.eliom:
[%%shared
type sellOrderCapture = {
  sellOrderId : int;
}
[@@deriving yojson]
 
type buyOrderCapture = {
  buyOrderId : int;
  quantity : int;
}
[@@deriving yojson]
 
type t = {
  sellOrder : sellOrderCapture;
  buyOrders : buyOrderCapture list;
}
[@@deriving yojson]
 
Error:
File "_server/trading_model.type_mli", line 17, characters 8-9:
Error: Syntax error
 
 
trading_model.type_mli:
module MatchCapture :
sig
  type sellOrderCapture = { sellOrderId : int; }
  val sellOrderCapture_to_yojson : sellOrderCapture -> Yojson.Safe.t
  val sellOrderCapture_of_yojson :
    Yojson.Safe.t -> sellOrderCapture Ppx_deriving_yojson_runtime.error_or
  type buyOrderCapture = { buyOrderId : int; quantity : int; }
  val buyOrderCapture_to_yojson : buyOrderCapture -> Yojson.Safe.t
  val buyOrderCapture_of_yojson :
    Yojson.Safe.t -> buyOrderCapture Ppx_deriving_yojson_runtime.error_or
  type t = {
    sellOrder : sellOrderCapture;
    buyOrders : buyOrderCapture list;
  }
  val to_yojson : t -> Yojson.Safe.t
  val of_yojson : Yojson.Safe.t -> t Ppx_deriving_yojson_runtime.error_or
  val _ : Yojson.Safe.t -> t Ppx_deriving_yojson_runtime.error_or
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions