@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
81 lines (41 loc) • 1.49 kB
Markdown
---
lang: en
title: 'API docs: repository-json-schema.getfieldsjsonschemafor'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository-json-schema
permalink: /doc/en/lb4/apidocs.repository-json-schema.getfieldsjsonschemafor.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository-json-schema](./repository-json-schema.md) > [getFieldsJsonSchemaFor](./repository-json-schema.getfieldsjsonschemafor.md)
## getFieldsJsonSchemaFor() function
Build a JSON schema describing the format of the "fields" object used to include or exclude properties of model instances.
**Signature:**
```typescript
export declare function getFieldsJsonSchemaFor(modelCtor: typeof Model, options?: FilterSchemaOptions): JsonSchema;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
modelCtor
</td><td markdown="1">
typeof Model
</td><td markdown="1">
The model constructor to build the filter schema for.
</td></tr>
<tr><td markdown="1">
options
</td><td markdown="1">
[FilterSchemaOptions](./repository-json-schema.filterschemaoptions.md)
</td><td markdown="1">
_(Optional)_
</td></tr>
</tbody></table>
**Returns:**
JsonSchema