mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-16 18:00:33 +03:00
parent
420c51a4ba
commit
454e5bd0e9
|
@ -151,6 +151,7 @@ ReDoc makes use of the following [vendor extensions](http://swagger.io/specifica
|
|||
* `suppress-warnings` - if set, warnings are not rendered at the top of documentation (they still are logged to the console).
|
||||
* `lazy-rendering` - if set, enables lazy rendering mode in ReDoc. This mode is useful for APIs with big number of operations (e.g. > 50). In this mode ReDoc shows initial screen ASAP and then renders the rest operations asynchronously while showing progress bar on the top. Check out the [demo](https://rebilly.github.io/ReDoc) for the example.
|
||||
* `hide-hostname` - if set, the protocol and hostname is not shown in the operation definition.
|
||||
* `hide-download-button` - do not show "Download" spec button. **THIS DOESN'T MAKE YOUR SPEC PRIVATE**, it just hides the button.
|
||||
* `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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="api-info-wrapper">
|
||||
<h1>{{info.title}} <span class="api-info-version">({{info.version}})</span></h1>
|
||||
<p class="download-openapi" *ngIf="specUrl">
|
||||
<p class="download-openapi" *ngIf="specUrl && !hideDownloadButton">
|
||||
Download OpenAPI specification:
|
||||
<a class="openapi-button" [attr.download]="downloadFilename" [attr.href]="specUrl"> Download </a>
|
||||
</p>
|
||||
|
|
|
@ -14,6 +14,9 @@ export class ApiInfo extends BaseComponent implements OnInit {
|
|||
info: any = {};
|
||||
specUrl: String | SafeResourceUrl;
|
||||
downloadFilename = '';
|
||||
|
||||
hideDownloadButton = this.optionsService.options.hideDownloadButton;
|
||||
|
||||
constructor(specMgr: SpecManager,
|
||||
private optionsService: OptionsService,
|
||||
elRef: ElementRef,
|
||||
|
|
|
@ -21,6 +21,7 @@ const OPTION_NAMES = new Set([
|
|||
'pathInMiddlePanel',
|
||||
'untrustedSpec',
|
||||
'hideLoading',
|
||||
'hideDownloadButton',
|
||||
'ignoredHeaderParameters',
|
||||
'nativeScrollbars',
|
||||
]);
|
||||
|
@ -31,6 +32,7 @@ export interface Options {
|
|||
specUrl?: string;
|
||||
suppressWarnings?: boolean;
|
||||
hideHostname?: boolean;
|
||||
hideDownloadButton?: boolean;
|
||||
lazyRendering?: boolean;
|
||||
expandResponses?: Set<string> | 'all';
|
||||
$scrollParent?: HTMLElement | Window;
|
||||
|
@ -105,6 +107,7 @@ export class OptionsService {
|
|||
if (isString(this._options.disableLazySchemas)) this._options.disableLazySchemas = true;
|
||||
if (isString(this._options.suppressWarnings)) this._options.suppressWarnings = true;
|
||||
if (isString(this._options.hideHostname)) this._options.hideHostname = true;
|
||||
if (isString(this._options.hideDownloadButton)) this._options.hideDownloadButton = 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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user