@@ -198,7 +198,7 @@ export default class RapiDoc extends LitElement {
198
198
</ div > `
199
199
}
200
200
201
- ${ ( this . allowTry === 'false' || ! this . resolvedSpec ) ? '' : this . apiServerListTemplate ( ) }
201
+ ${ ( this . allowTry === 'false' || this . allowServerSelection === 'false' || ! this . resolvedSpec ) ? '' : this . apiServerListTemplate ( ) }
202
202
${ ( this . allowAuthentication === 'false' || ! this . resolvedSpec || ! this . resolvedSpec . securitySchemes ) ? '' : this . securitySchemeTemplate ( ) }
203
203
${ this . resolvedSpec && this . resolvedSpec . tags ? this . endpointsGroupedByTagTemplate ( ) : '' }
204
204
@@ -340,6 +340,7 @@ export default class RapiDoc extends LitElement {
340
340
showInfo : { type : String , attribute : 'show-info' } ,
341
341
allowAuthentication : { type : String , attribute : 'allow-authentication' } ,
342
342
allowTry : { type : String , attribute : 'allow-try' } ,
343
+ allowServerSelection : { type : String , attribute : 'allow-server-selection' } ,
343
344
allowSpecUrlLoad : { type : String , attribute : 'allow-spec-url-load' } ,
344
345
allowSpecFileLoad : { type : String , attribute : 'allow-spec-file-load' } ,
345
346
allowSearch : { type : String , attribute : 'allow-search' } ,
@@ -436,6 +437,13 @@ export default class RapiDoc extends LitElement {
436
437
437
438
afterSpecParsedAndValidated ( spec ) {
438
439
this . resolvedSpec = spec ;
440
+ if ( this . allowServerSelection === 'false' ) {
441
+ if ( this . serverUrl ) {
442
+ this . selectedServer = this . serverUrl ;
443
+ } else if ( this . resolvedSpec && this . resolvedSpec . servers && this . resolvedSpec . servers . length > 0 ) {
444
+ this . selectedServer = this . resolvedSpec . servers [ 0 ] . url ;
445
+ }
446
+ }
439
447
this . requestUpdate ( ) ;
440
448
window . setTimeout ( ( ) => {
441
449
this . onApiServerChange ( ) ;
0 commit comments