---
lang: en
title: 'API docs: openapi-v3.requestbody.array'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.openapi-v3.requestbody.array.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/openapi-v3](./openapi-v3.md) &gt; [requestBody](./openapi-v3.requestbody.md) &gt; [array](./openapi-v3.requestbody.array.md)

## requestBody.array variable

Define a requestBody of `array` type.

<b>Signature:</b>

```typescript
array: (itemSpec: SchemaObject | ReferenceObject, properties?: {
        description?: string | undefined;
        required?: boolean | undefined;
    } | undefined) => (target: Object, member: string, index: number) => void
```

## Example


```ts
export class MyController {
  @post('/greet')
  greet(@requestBody.array(
    {schema: {type: 'string'}},
    {description: 'an array of names', required: false}
  ) names: string[]): string {
    return `Hello, ${names}`;
  }
}

```


