Skip to content

Commit 426e5b6

Browse files
committed
fix: do not auto-append security-definitions if they are not in the spec
1 parent ca81b6d commit 426e5b6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/services/OpenAPIParser.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ export class OpenAPIParser {
6868
}
6969

7070
preprocess(spec: OpenAPISpec) {
71-
if (!this.options.noAutoAuth && spec.info) {
71+
if (
72+
!this.options.noAutoAuth &&
73+
spec.info &&
74+
spec.components &&
75+
spec.components.securitySchemes
76+
) {
7277
// Automatically inject Authentication section with SecurityDefinitions component
7378
const description = spec.info.description || '';
7479
const securityRegexp = new RegExp(

0 commit comments

Comments
 (0)