Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESTful JSON API using Eliom example not working #13

Open
MikkelStorgaard opened this issue Aug 30, 2019 · 1 comment
Open

RESTful JSON API using Eliom example not working #13

MikkelStorgaard opened this issue Aug 30, 2019 · 1 comment

Comments

@MikkelStorgaard
Copy link

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
@balat
Copy link
Member

balat commented Apr 22, 2021

No idea about this one. Is this fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants