package ppx_deriving_jsonschema
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Jsonschema generator for ppx_deriving
Install
dune-project
Dependency
Authors
Maintainers
Sources
ppx_deriving_jsonschema-0.0.7.tbz
sha256=5bb0bf3f1febb3153a41f11434bbcd1a63059ed8ef18d758e7af7ce6947506dc
sha512=5a7a8f64fcdbd3554aa7af21b5d4e420f90bc43f232fe769c00d0bd928529bada2b469f80cac8fbd30ecbddbba4de1b3d455b6463773e77e4b34a54360bce648
doc/src/ppx_deriving_jsonschema.runtime/ppx_deriving_jsonschema_runtime.ml.html
Source file ppx_deriving_jsonschema_runtime.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41let schema_version = "https://json-schema.org/draft/2020-12/schema" (* There is no Yojson.Basic.t in Melange and the Melange_json.t is not compatible with Yojson.Basic.t, so we use our own type to support universal API. Platform-specific conversion is in classify.ml (native: Obj.magic coercion; Melange: Js.Json decode). *) type t = [ `Null | `String of string | `Float of float | `Int of int | `Bool of bool | `List of t list | `Assoc of (string * t) list ] let classify = Ppx_deriving_jsonschema_classify.classify let json_schema ?id ?title ?description ?definitions types = match types with | `Assoc types -> let metadata = List.filter_map (fun x -> x) [ Some ("$schema", `String schema_version); (match id with | None -> None | Some id -> Some ("$id", `String id)); (match title with | None -> None | Some title -> Some ("title", `String title)); (match description with | None -> None | Some description -> Some ("description", `String description)); (match definitions with | None -> None | Some defs -> Some ("$defs", `Assoc defs)); ] in `Assoc (metadata @ types)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>