OCaml let namevalue_of_req x = y and let namevalue_to_req y = x printer of Request Body object serialization functions.
Each OpenAPI Request Body Object can have many content types like "application/x-www-form-urlencoded" that have specialized rules for how to serialize it.
Confer Describing Request Body and OpenAPI Request Body Object.
This version does not support Encoding objects. Instead, the assumption is that all object fields are encoded as deepObject and explode = true, and all other fields are encoded as form.
ctype argument
The content type of the request body like "application/x-www-form-urlencoded".
OpenAPI allows multiple content types for a request body, so a client can generate code that picks only one (probably the "application/json" if present) while a server must accept all of them and route based on the "Content-Type" request header.
One of:
`FormUrlEncodedis"application/x-www-form-urlencoded". Each name and value will be URL encoded per RFC 1866 (also Percent encoding). That means newline normalizaiton, replacing spaces with"+"s, and doing URL encoding for the query component of the URL, and separating name-values with"&"and names from values with"=". So"+&="are reserved by definition, and all the query component reserved characters are also reserved. ForUrithe percent encoding matches the`Query_keycomponent. This version does not support Encoding objects. Instead, the assumption is that allobjectfields are encoded asdeepObjectandexplode = true, and all other fields are encoded asform(withexplode = trueforarrayfields). Confer: Support for x-www-form-urlencoded Request Bodies`Jsonis"application/json"
style argument
A subset of the OpenAPI style property relevant to request bodies.
Confer OpenAPI Specification Style Examples.
One of:
`Form`DeepObject`Simple- unused since don't support Encoding objects in application/x-www-form-urlencoded yet`Label- unused since don't support Encoding objects in application/x-www-form-urlencoded yet`SpaceDelimited- unused since don't support Encoding objects in application/x-www-form-urlencoded yet`PipeDelimited- unused since don't support Encoding objects in application/x-www-form-urlencoded yet
explode argument
The OpenAPI explode property.
Confer OpenAPI Specification Style Examples.
val serializername :
(module OaDocument.STANDARD) ->
[< `PrimitiveType of string | `TypeAlias of string ] ->
stringinclude 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.

