Function: getJsonSchema

getJsonSchema(ctor: Function) : JSONSchema

Gets the JSON Schema of a TypeScript model/class by seeing if one exists in a cache. If not, one is generated and then cached.

Parameters
Name Type Default Value Flags Description
ctor Function

Contructor of class to get JSON Schema from

Function: isArrayType

isArrayType(type: string | Function) : boolean

Determines whether a given string or constructor is array type or not

Parameters
Name Type Default Value Flags Description
type string | Function

Type as string or wrapper

Function: metaToJsonProperty

metaToJsonProperty(meta: PropertyDefinition) : JSONSchema

Converts property metadata into a JSON property definition

Parameters
Name Type Default Value Flags Description
meta PropertyDefinition

Function: modelToJsonSchema

modelToJsonSchema(ctor: Function) : JSONSchema

Converts a TypeScript class into a JSON Schema using TypeScript's reflection API

Parameters
Name Type Default Value Flags Description
ctor Function

Constructor of class to convert from

Function: stringTypeToWrapper

stringTypeToWrapper(type: string | Function) : Function

Gets the wrapper function of primitives string, number, and boolean

Parameters
Name Type Default Value Flags Description
type string | Function

Name of type