-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
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)
eError: Dangling reference #/definitions/a
Fatal error: exception Json_schema.Dangling_reference(_)
I think it'd be worth making a new release
Metadata
Metadata
Assignees
Labels
No labels