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(ctor: Function, options?: JsonSchemaOptions): JSONSchema;

Parameters

Parameter Type Description
ctor Function Contructor of class to get JSON Schema from
options JsonSchemaOptions  

Returns:

JSONSchema