Primitives
single_item_array kind gets the single element of the schema kind kind if and only if the kind is an array and it has only one item.
val pp_type_string :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
enum:Json_repr.any list option ->
Json_schema.string_specs ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_type_integer :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
enum:Json_repr.any list option ->
Json_schema.numeric_specs ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_type_number :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
Json_schema.numeric_specs ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_type_boolean :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
enum:Json_repr.any list option ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_type_null :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_type_any :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_type_unit :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_encoder_string :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
enum:Json_repr.any list option ->
Json_schema.string_specs ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_encoder_integer :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
enum:Json_repr.any list option ->
Json_schema.numeric_specs ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_encoder_number :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
Json_schema.numeric_specs ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_encoder_boolean :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
enum:Json_repr.any list option ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_encoder_null :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_encoder_any :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval pp_encoder_unit :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
Restapis_o.Open__.Format.formatter ->
unit ->
unitval primitive_pp_type :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
enum:Json_repr.any list option ->
OaTypes.schema_kind ->
(Restapis_o.Open__.Format.formatter -> unit -> unit) optionprimitive_pp_type standard vendor ~format kind gets the primitive type pretty-printer if and only if the schema kind kind is a primitive type.
val primitive_pp_encoder :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
format:string option ->
enum:Json_repr.any list option ->
OaTypes.schema_kind ->
(Restapis_o.Open__.Format.formatter -> unit -> unit) optionprimitive_pp_encoder standard vendor ~format kind gets the primitive encoder pretty-printer if and only if the schema kind kind is a primitive type.
val is_optional :
(module OaDocument.STANDARD) ->
(module OaDocument.VENDOR) ->
required:bool ->
nullable:bool ->
format:string option ->
enum:Json_repr.any list option ->
[ `PrimitiveAny
| `PrimitiveBoolean
| `PrimitiveInteger of Json_schema.numeric_specs
| `PrimitiveNull
| `PrimitiveNumber of Json_schema.numeric_specs
| `PrimitiveString of Json_schema.string_specs ]
option ->
boolis_optional standard vendor ~required ~nullable ~format ~enum primkind is true when a field that may be required and/or nullable, having format format and a possible enumeration of values enum, being of possible primitive type primkind, is optional.
Primitive Types
The standard and vendor modules are queried through their OaDocument.STANDARD.primitive_never_optional and OaDocument.VENDOR.primitive_never_optional configuration. If either is true then is_optional is always false.
Variants
caseize s make a capitalized case name of the string s.
s may be a type name or an enumeration value.
Duplicates need to be handled by the vendor extension. For example, Stripe's timezone value "Etc/GMT+0" is indistinguishable (after replacing non-alphanumeric characters with underscores) from "Etc/GMT-0".
include DkCoder_Std.SCRIPT
__init context is the entry point for running a script module. The DkCoder compiler will inject this function at the top and bottom of the script module. The top __init does nothing, while the bottom __init calls the prior __init.
That means:
- calling the
__initfunction guarantees that the script module is initialized; that is, all of the script module's side-effects (ex.let () = Format.printf "Hello world@.") are executed before the__initreturns to the caller. - you can override the
__initfunction by simply defining the__initidempotently. That will shadow the top__initand when the bottom__initis executed your__initwill be called instead of the do-nothing top__init.
Future versions of DkCoder will call __init in dependency order for all `You script modules. Your __init function may be called several times.
__repl context is the entry point for debugging a script module in a REPL. The DkCoder compiler will inject this function at the top and bottom of the script module. The top __repl does nothing, while the bottom __repl calls the prior __repl.
That means:
- you can override the
__replfunction by simply defining the__replidempotently. That will shadow the top__repland when the bottom__replis executed your__replwill be called instead of the do-nothing top__repl.
The run-time module information for the script module.

