mirror of
https://github.com/Redocly/redoc.git
synced 2024-12-01 21:03:45 +03:00
fix: do not auto-append security-definitions if they are not in the spec
This commit is contained in:
parent
ca81b6dfaf
commit
426e5b67ab
|
@ -68,7 +68,12 @@ export class OpenAPIParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
preprocess(spec: OpenAPISpec) {
|
preprocess(spec: OpenAPISpec) {
|
||||||
if (!this.options.noAutoAuth && spec.info) {
|
if (
|
||||||
|
!this.options.noAutoAuth &&
|
||||||
|
spec.info &&
|
||||||
|
spec.components &&
|
||||||
|
spec.components.securitySchemes
|
||||||
|
) {
|
||||||
// Automatically inject Authentication section with SecurityDefinitions component
|
// Automatically inject Authentication section with SecurityDefinitions component
|
||||||
const description = spec.info.description || '';
|
const description = spec.info.description || '';
|
||||||
const securityRegexp = new RegExp(
|
const securityRegexp = new RegExp(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user