Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified dist/index.html.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions dist/rapidoc-min.js

Large diffs are not rendered by default.

Binary file modified dist/rapidoc-min.js.gz
Binary file not shown.
Binary file modified dist/rapidoc-min.js.map.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions dist/report.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/rapidoc-min.js

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/rapidoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export default class RapiDoc extends LitElement {
</div>`
}

${(this.allowTry==='false' || !this.resolvedSpec) ?``:html`
${(this.showServerSelect==='false' || this.allowTry==='false' || !this.resolvedSpec) ?``:html`
<div class="sub-title regular-font section-gap">
<a id="api_server_options"> API SERVER: </a>
<div class="mono-font" style="margin: 12px 0; font-size:calc(var(--small-font-size) + 1px);">
Expand Down Expand Up @@ -312,6 +312,7 @@ export default class RapiDoc extends LitElement {
monoFont : { type: String, attribute: 'mono-font' },
showHeader : { type: String, attribute: 'show-header' },
showInfo : { type: String, attribute: 'show-info' },
showServerSelect : { type: String, attribute: 'show-server-select' },
allowAuthentication: { type: String, attribute: 'allow-authentication' },
allowTry : { type: String, attribute: 'allow-try' },
allowSpecUrlLoad: { type: String, attribute: 'allow-spec-url-load' },
Expand Down Expand Up @@ -412,6 +413,13 @@ export default class RapiDoc extends LitElement {

afterSpecParsedAndValidated(spec, isReloadingSpec=false){
this.resolvedSpec = spec;
if(this.showServerSelect==='false') {
if(this.serverUrl) {
this.selectedServer = this.serverUrl;
} else if(this.resolvedSpec && this.resolvedSpec.servers && this.resolvedSpec.servers.length>0) {
this.selectedServer = this.resolvedSpec.servers[0].url;
}
}
this.requestUpdate();
window.setTimeout(()=>{
this.onApiServerChange()
Expand Down