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.8.tbz
sha256=c5a2f8c1d906c1890bcde81aa149cc38e479878eb6c1c45a8455d03a95a07c2e
sha512=c0e661717244bf62132a21ef975db2720597b1d8013b0221c1d7db5adfc14928caf675c0f2fd89869ee6f4f96527599e556a0c123cd9dc7f65cad8f81de322ef
doc/CHANGES.html
0.0.8
- add runtime primitive schema modules under
Ppx_deriving_jsonschema_runtime.Primitivesfor Yojson and Melange JSON backends; generated code now uses the selected primitive bindings, including backend-specificint64handling and Melange JSONresultschemas - add
Ppx_deriving_jsonschema_runtime.declassifyand simplify[@jsonschema.default]serialization so non-primitive and parametric default values can be converted through their generated*_to_jsonfunctions - fix
type nonrecand other non-recursive type declarations so aliases are not treated as recursive self-references - add
[@@jsonschema.compact_variants]support on polymorphic variant type declarations - document primitive modules, result schemas,
compact_variants, and the completed[@jsonschema.attrs]example in the README - update GitHub Actions used by build and documentation workflows
0.0.7
- add
[@@jsonschema.compact_variants]attribute on variant type declarations to render unit constructors as plain string constants ({ "const": "Name" }) instead of single-element tuple arrays; constructors with arguments keep the tuple array encoding - add
[@@jsonschema.format]attribute to add a format to a type or a field; now also supported on core types (e.g. variant payloads:A of (string[@jsonschema.format "date-time"])); validated to only apply tostringandbytestypes - add
[@@jsonschema.description]attribute to add a description to a type or a field; now also supported on core types (e.g. variant payloads and inline type annotations) and on polymorphic variant tags - add
~ocaml_docflag on[@@deriving jsonschema]to useocaml.docattributes (i.e.(** ... *)doc comments) as a fallback for[@@jsonschema.description]when the explicit annotation is absent; off by default - add
[@jsonschema.attrs]composite attribute to bundle multiple schema annotations in a single record expression (e.g.[@jsonschema.attrs { maximum = 100; minimum = 0; description = "Score out of 100" }]); supported on core types, label declarations, and type declarations - add
[@jsonschema.default <value>]attribute on record fields to set a JSON Schema"default"value; fields with a default are excluded fromrequired; primitive literals (int,int32,nativeint,float,string,bytes,bool, and theiroption,list,arrayvariants) are serialized automatically; non-primitive types (custom variants, records, etc.) require a<type>_to_json : <type> -> Yojson.Basic.tfunction to be in scope (e.g. via[@@deriving json]); also accepts the[@default]shorthand for compatibility with melange-json - make option types nullable in generated JSON Schema (e.g.
int option→{"type":["integer","null"]}); add[@@jsonschema.option]attribute to opt a field out ofrequiredwithout making its type nullable - fix schema generation for parametric recursive types (e.g.
type 'a t = ... | B of 'a t) - fix broken
$refscoping when a recursive type uses a parametric recursive type with itself as a type argument (e.g.type t = ... | N of t wrapperwherewrapperis also recursive); inner$defsare now hoisted into the root schema's$defsnamespace - fix generated code to qualify all stdlib references (
List.filter,List.assoc_opt,List.mem_assoc,List.map,Array.to_list,Array.map) withStdlib.so it compiles in scopes that shadow the stdlib (e.g.open Base,open Core,open Containers) - refactor runtime using
server-reason-react'sbrowser_onlyppx to share more code between the native and melange runtimes - raise lower bounds to match what the code now requires:
ocaml >= 5.0.0,ppxlib > 0.36.0,melange-json >= 2.0.0,melange-json-native >= 2.0.0; declareconf-npmandconf-python-3as test dependencies so the melange cram test can run in the opam sandbox
0.0.6
- update jsonschema derivation to use t instead of Yojson.Basic for type signatures
0.0.5
- add support for recursive types (self-referential)
- add support for mutually recursive types (defined with
and) - add support to polymorphic types
0.0.4
- add [@@json.allow_extra_fields] attribute
0.0.3
- make the default format compatible with the deriving ppxes
0.0.2
- add support for nativeint, bytes, ref, unit
- add ~variant_as_array for compatibility with ppx_deriving_yojson
- support variant payloads
- support polymorphic variants inheritance
- fix encoding of tuples
- change encoding of variants from enum to anyOf
0.0.1
- Initial alpha with basic features + @name @key @ref
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>