Skip to content

Commit 37885c2

Browse files
authored
Fix SecurityRequirementsObject to allow partial security schemes (#1648)
* Fix SecurityRequirementsObject to allow partial security schemes * Added changeset * Lint
1 parent 6a32a28 commit 37885c2

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/gorgeous-people-smile.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-typescript": patch
3+
---
4+
5+
Fixed issue with security not allowing partial requirements

packages/openapi-typescript/src/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,9 @@ export interface OAuthFlowObject extends Extensable {
616616
* [4.8.30] Security Requirements Object
617617
* Lists the required security schemes to execute this operation. The name used for each property MUST correspond to a security scheme declared in the Security Schemes under the Components Object.
618618
*/
619-
export type SecurityRequirementObject = Record<keyof ComponentsObject["securitySchemes"], string[]>;
619+
export type SecurityRequirementObject = {
620+
[P in keyof ComponentsObject["securitySchemes"]]?: string[];
621+
};
620622

621623
export interface OpenAPITSOptions {
622624
/** Treat all objects as if they have `additionalProperties: true` by default (default: false) */

0 commit comments

Comments
 (0)