package atd

  1. Overview
  2. Docs

Translate an ATD file to JSON Schema, honoring the <json ...> annotations.

type version =
  1. | Draft_2019_09
  2. | Draft_2020_12

These are the versions of the JSON Schema currently supported.

See https://json-schema.org/draft/2020-12/release-notes.html for the differences between 2019-09 and 2020-12.

val default_version : version
val annot_schema : Annot.schema

This is for validating the ATD file, not for JSON Schema.

val print : ?version:version -> ?xprop:bool -> src_name:string -> root_type:string -> Stdlib.out_channel -> Ast.full_module -> unit

Translate an ATD AST to a JSON Schema.

  • parameter xprop

    whether to allow extra fields in JSON objects. The default is true, which is JSON Schema's default.