Page Contents

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

modelToJsonSchema() function

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

Signature:

export declare function modelToJsonSchema(ctor: Function, jsonSchemaOptions?: JsonSchemaOptions): JSONSchema;

Parameters

Parameter Type Description
ctor Function Constructor of class to convert from
jsonSchemaOptions JsonSchemaOptions  

Returns:

JSONSchema