Docs@skmtc/core

OpenAPI document

CLASS

OasSecurityRequirement

@skmtc/core 0.63.4

The security schemes that a request needs together. When an operation has more than one requirement, a request needs to satisfy only one of them.

A requirement with no schemes lets a request have no security.

Signature

import { OasSecurityRequirement } from '@skmtc/core'

class OasSecurityRequirement

Constructor

constructor

constructor(fields: SecurityFields, oasDocument: OasDocument)

Properties

oasType, 'securityRequirement'
requirement, Record<string, string[]>

The name of each scheme, with the scopes that the request needs.

Methods

toSecurityScheme

toSecurityScheme(): OasSecurityScheme[]

The schemes that requirement names, without their names and scopes. It leaves out mutualTLS schemes, which core does not parse, so it can give fewer schemes than a request needs.

Throws

when a scheme is a reference that names nothing and parse.danglingRefs keeps it

toJsonSchema

toJsonSchema(): OpenAPIV3.SecurityRequirementObject