openapi_client.util

General purpose utility functions for generating Dlang source files.

Members

Functions

isNull
bool isNull(Json obj)

A simple check whether an object is present, permitting consistency with std.typecons.Nullable.

isNull
bool isNull(T obj)

A simple check whether an object is present, permitting consistency with std.typecons.Nullable.

resolveTemplate
string resolveTemplate(string urlTemplate, string[string] params)

Given a string with bracket parameters, e.g. "hello/{name}", and an associative array of parameters, substitute parameter values and return the new string.

serializeDeepObject
FormFields serializeDeepObject(T obj)
void serializeDeepObject(Json json, string keyPrefix, FormFields fields)

Serialize an object according to DeepObject style.

toCamelCase
string toCamelCase(string input, bool firstCapital)
Undocumented in source. Be warned that the author may not have intended to support it.
toLowerCamelCase
string toLowerCamelCase(string input)

Converts a string in "snake_case" to "lowerCamelCase".

toUpperCamelCase
string toUpperCamelCase(string input)

Converts a string in "snake_case" to "UpperCamelCase".

wordWrapLine
string[] wordWrapLine(string text, size_t lineWidth, char sep)

Separates a single long line into separate lines, performing word-wrapping where possible.

wordWrapText
string[] wordWrapText(string text, size_t lineWidth, char sep)

Given a block of text, first split it using the "\n" escape, and then word-wrap each line.

writeCommentBlock
void writeCommentBlock(Appender!string buffer, string text, string prefix, size_t lineWidth)

Converts a long text into a a D-style comment block and writes it to a buffer.

Meta