Low-level values (functions, constants) shared among OpenAPI generator implementations.
Logs
Parsers
Converters
val definitive_optionality :
required:bool ->
nullable:bool ->
'a option ->
[ `DefinitivelyOptional | `DefinitivelyRequired | `Undetermined of 'a ]
definitive_optionality ~required ~nullable 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 definitely optional or definitely required. When it is not definitive one way or the other, then an `Undetermined primkind
is returned.
Printers
val pp_callfunc :
?bare:unit ->
func:string ->
(Restapis_o.Open__.Format.formatter -> 'a -> unit) ->
Restapis_o.Open__.Format.formatter ->
'a ->
unit
val path_as_json_ptr :
?wildcards:bool ->
[< `Field of string | `Index of int | `Next | `Star ] list ->
string
val pp_path :
Restapis_o.Open__.Format.formatter ->
[< `Field of string | `Index of int | `Next | `Star Field ] list ->
unit
type operation_id = OaTypes.operation_id =
| OpPath of {
doc_path : Json_query.path;
path_template : string;
name : string;
}
| OpId of {
}
val pp_operation_id :
brief:bool ->
Restapis_o.Open__.Format.formatter ->
operation_id ->
unit
val pp_numeric_specs :
Restapis_o.Open__.Format.formatter ->
Json_schema.numeric_specs ->
unit
val pp_operation :
brief_operation_id:bool ->
Restapis_o.Open__.Format.formatter ->
OaTypes.operation ->
unit
Errors
val print_error :
?print_unknown:(Restapis_o.Open__.Format.formatter -> exn -> unit) ->
Restapis_o.Open__.Format.formatter ->
exn ->
unit
Document Paths
val paths_path_of_template :
?paths_path:string ->
string ->
[> `Field of string | `Index of int | `Next ] list
val parameter_path_of_name :
?parameters_path:string ->
string ->
[> `Field of string | `Index of int | `Next ] list
val schema_path_of_name :
?schemas_path:string ->
string ->
[> `Field of string | `Index of int | `Next ] list
val header_path_of_name :
?headers_path:string ->
string ->
[> `Field of string | `Index of int | `Next ] list
val request_body_path_of_name :
?request_bodies_path:string ->
string ->
[> `Field of string | `Index of int | `Next ] list
val response_path_of_name :
?responses_path:string ->
string ->
[> `Field of string | `Index of int | `Next ] list
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
__init
function 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__init
returns to the caller. - you can override the
__init
function by simply defining the__init
idempotently. That will shadow the top__init
and when the bottom__init
is executed your__init
will 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
__repl
function by simply defining the__repl
idempotently. That will shadow the top__repl
and when the bottom__repl
is executed your__repl
will be called instead of the do-nothing top__repl
.
The run-time module information for the script module.