Skip to content

New release? #23

@edwintorok

Description

@edwintorok

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

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