Skip to content

Commit

Permalink
new: option to disable authentication auto adding
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Apr 19, 2017
1 parent 0ee1476 commit 00b304a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<redoc>` element you can initialize ReDoc via globally exposed `Redoc` object:
Expand Down
1 change: 1 addition & 0 deletions lib/services/app-state.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export class AppStateService {
error = new BehaviorSubject<any>(null);
loading = new Subject<boolean>();
initialized = new BehaviorSubject<any>(false);
rightPanelHidden = new BehaviorSubject<any>(false);

searchContainingPointers = new BehaviorSubject<string|null[]>([]);

Expand Down
5 changes: 4 additions & 1 deletion lib/services/options.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const OPTION_NAMES = new Set([
'hideHostname',
'lazyRendering',
'expandResponses',
'requiredPropsFirst'
'requiredPropsFirst',
'noAutoAuth'
]);

export interface Options {
Expand All @@ -29,6 +30,7 @@ export interface Options {
expandResponses?: Set<string> | 'all';
$scrollParent?: HTMLElement | Window;
requiredPropsFirst?: boolean;
noAutoAuth?: boolean;
spec?: any;
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 00b304a

Please sign in to comment.