Page Contents

Home > @loopback/repository-json-schema > getJsonSchema

getJsonSchema() function

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.

Signature:

export declare function getJsonSchema<T extends object>(ctor: Function & {
    prototype: T;
}, options?: JsonSchemaOptions<T>): JSONSchema;

Parameters

Parameter Type Description
ctor Function & {
prototype: T;
}
Contructor of class to get JSON Schema from
options JsonSchemaOptions<T>  

Returns:

JSONSchema