@loopback/docs
Version:
Documentation for LoopBack 4
35 lines (22 loc) • 979 B
Markdown
lang: en
title: 'API docs: repository-json-schema.modeltojsonschema'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository-json-schema.modeltojsonschema.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository-json-schema](./repository-json-schema.md) > [modelToJsonSchema](./repository-json-schema.modeltojsonschema.md)
## modelToJsonSchema() function
Converts a TypeScript class into a JSON Schema using TypeScript's reflection API
<b>Signature:</b>
```typescript
export declare function modelToJsonSchema(ctor: Function, jsonSchemaOptions?: JsonSchemaOptions): JSONSchema;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| ctor | <code>Function</code> | Constructor of class to convert from |
| jsonSchemaOptions | <code>JsonSchemaOptions</code> | |
<b>Returns:</b>
`JSONSchema`