# WebSocketMockIntegrationProps

Props for Mock type integration for a WebSocket Api.

Extends: WebSocketMockIntegrationProps
Used as props by: WebSocketMockIntegration

- Source: [`aws-apigatewayv2-integrations/lib/websocket/mock.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigatewayv2-integrations/lib/websocket/mock.ts#L13)
- Type last changed: v2.176.0 · 15 Jan 2025

## Example

```ts
import { WebSocketMockIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';

const webSocketApi = new apigwv2.WebSocketApi(this, 'mywsapi');
new apigwv2.WebSocketStage(this, 'mystage', {
  webSocketApi,
  stageName: 'dev',
  autoDeploy: true,
});

webSocketApi.addRoute('sendMessage', {
  integration: new WebSocketMockIntegration('DefaultIntegration', {
    requestTemplates: { 'application/json': JSON.stringify({ statusCode: 200 }) },
    templateSelectionExpression: '\\$default',
  }),
  returnResponse: true,
});
```

## Properties

- `requestTemplates`: { [key: string]: string } — A map of Apache Velocity templates that are applied on the request payload.

  **Default:** No request template provided to the integration.

  ```
    { "application/json": "{ \"statusCode\": 200 }" }
  ```

- `templateSelectionExpression`: string — The template selection expression for the integration.

  **Default:** No template selection expression provided.
