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

New release? #23

Open
edwintorok opened this issue Aug 29, 2018 · 0 comments
Open

New release? #23

edwintorok opened this issue Aug 29, 2018 · 0 comments

Comments

@edwintorok
Copy link

edwintorok commented Aug 29, 2018

Using 0.6 from opam mu fails with dangling reference error, however using the latest git code from master works:

open Json_encoding
let reclist itemencoding =
  mu "list" @@ fun self ->
  union
    [ case (string_enum [ "nil", () ])
        (function [] -> Some () | _ :: _ -> None)
        (fun () -> []) ;
      case (obj2 (req "hd" itemencoding) (req "tl" self))
        (function hd :: tl -> Some (hd, tl) | [] -> None)
        (fun (hd, tl) -> hd :: tl) ];;

let () =
  try
    reclist (def "a" int) |> Json_encoding.schema |> Json_schema.to_json |> Ezjsonm.wrap |>
    Ezjsonm.to_string ~minify:false |> print_endline
  with e ->
    Format.eprintf "Error: %a@."
      (Json_encoding.print_error ?print_unknown:None)
      e
Error: Dangling reference #/definitions/a
Fatal error: exception Json_schema.Dangling_reference(_)

I think it'd be worth making a new release

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

1 participant