From 00b304a4bece7ef009d8df6b766be240b4e3bac6 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Tue, 18 Apr 2017 16:39:58 +0300 Subject: [PATCH] new: option to disable authentication auto adding --- README.md | 1 + lib/services/app-state.service.ts | 1 + lib/services/options.service.ts | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ffedfd87..e05a3c1e 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,7 @@ ReDoc makes use of the following [vendor extensions](http://swagger.io/specifica * `hide-hostname` - if set, the protocol and hostname is not shown in the operation definition. * `expand-responses` - specify which responses to expand by default by response codes. Values should be passed as comma-separated list without spaces e.g. `expand-responses="200,201"`. Special value `"all"` expands all responses by default. Be careful: this option can slow-down documentation rendering time. * `required-props-first` - show required properties first ordered in the same order as in `required` array. +* `no-auto-auth` - do not inject Authentication section automatically ## Advanced usage Instead of adding `spec-url` attribute to the `` element you can initialize ReDoc via globally exposed `Redoc` object: diff --git a/lib/services/app-state.service.ts b/lib/services/app-state.service.ts index 59e34c36..24eb85bd 100644 --- a/lib/services/app-state.service.ts +++ b/lib/services/app-state.service.ts @@ -10,6 +10,7 @@ export class AppStateService { error = new BehaviorSubject(null); loading = new Subject(); initialized = new BehaviorSubject(false); + rightPanelHidden = new BehaviorSubject(false); searchContainingPointers = new BehaviorSubject([]); diff --git a/lib/services/options.service.ts b/lib/services/options.service.ts index 1747efef..f9fe3b6c 100644 --- a/lib/services/options.service.ts +++ b/lib/services/options.service.ts @@ -16,7 +16,8 @@ const OPTION_NAMES = new Set([ 'hideHostname', 'lazyRendering', 'expandResponses', - 'requiredPropsFirst' + 'requiredPropsFirst', + 'noAutoAuth' ]); export interface Options { @@ -29,6 +30,7 @@ export interface Options { expandResponses?: Set | 'all'; $scrollParent?: HTMLElement | Window; requiredPropsFirst?: boolean; + noAutoAuth?: boolean; spec?: any; } @@ -95,6 +97,7 @@ export class OptionsService { if (isString(this._options.hideHostname)) this._options.hideHostname = true; if (isString(this._options.lazyRendering)) this._options.lazyRendering = true; if (isString(this._options.requiredPropsFirst)) this._options.requiredPropsFirst = true; + if (isString(this._options.noAutoAuth)) this._options.noAutoAuth = true; if (isString(this._options.expandResponses)) { let str = this._options.expandResponses as string; if (str === 'all') return;