@loopback/docs
Version:
Documentation for LoopBack 4
35 lines (22 loc) • 988 B
Markdown
lang: en
title: 'API docs: repository-json-schema.getjsonschema'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository-json-schema.getjsonschema.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository-json-schema](./repository-json-schema.md) > [getJsonSchema](./repository-json-schema.getjsonschema.md)
## 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.
<b>Signature:</b>
```typescript
export declare function getJsonSchema(ctor: Function, options?: JsonSchemaOptions): JSONSchema;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| ctor | <code>Function</code> | Contructor of class to get JSON Schema from |
| options | <code>JsonSchemaOptions</code> | |
<b>Returns:</b>
`JSONSchema`