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: isComplexType

isComplexType(ctor: Function) : boolean

Determines whether the given constructor is a custom type or not

Parameters
Name Type Default Value Flags Description
ctor Function

Constructor

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

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

Parameters
Name Type Default Value Flags Description
type string

Name of type