---
lang: en
title: 'API docs: openapi-v3.mergesecurityschemetospec'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/openapi-v3
permalink: /doc/en/lb4/apidocs.openapi-v3.mergesecurityschemetospec.html
---

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

[Home](./index.md) &gt; [@loopback/openapi-v3](./openapi-v3.md) &gt; [mergeSecuritySchemeToSpec](./openapi-v3.mergesecurityschemetospec.md)

## mergeSecuritySchemeToSpec() function

Security scheme merge helper function to patch the current OpenAPI spec. It provides a direct route to add a security schema to the specs components. It returns a new merged object without modifying the original one.

<b>Signature:</b>

```typescript
export declare function mergeSecuritySchemeToSpec(spec: OpenApiSpec, schemeName: string, schemeSpec: SecuritySchemeObject): OpenApiSpec;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  spec | <code>OpenApiSpec</code> |  |
|  schemeName | <code>string</code> |  |
|  schemeSpec | <code>SecuritySchemeObject</code> |  |

<b>Returns:</b>

`OpenApiSpec`


