mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-26 10:33:44 +03:00
new: option to disable authentication auto adding
This commit is contained in:
parent
0ee1476590
commit
00b304a4be
|
@ -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:
|
||||
|
|
|
@ -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[]>([]);
|
||||
|
||||
|
|
|
@ -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<string> | '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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user