@loopback/docs
Version:
Documentation for LoopBack 4
37 lines (24 loc) • 1.3 kB
Markdown
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) > [@loopback/openapi-v3](./openapi-v3.md) > [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> | The name of the security scheme to be added |
| schemeSpec | <code>SecuritySchemeObject</code> | The security scheme spec body to be added, |
<b>Returns:</b>
`OpenApiSpec`