Skip to content

Commit c95329b

Browse files
feat(W-15607551): server name
1 parent 04b9376 commit c95329b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/ApiEndpointDocumentationElement.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,14 @@ export class ApiEndpointDocumentationElement extends AmfHelperMixin(LitElement)
194194
* If true, the server selector custom base URI option is rendered
195195
*/
196196
allowCustomBaseUri: { type: Boolean },
197+
/**
198+
* Adds a servers to async API
199+
*
200+
* @param {string} url - The URL of the server.
201+
* @param {object} [description] - An object containing a string `description` property.
202+
*/
203+
servers: {type:Array},
204+
_servers: {type:Array},
197205
};
198206
}
199207

@@ -299,6 +307,20 @@ export class ApiEndpointDocumentationElement extends AmfHelperMixin(LitElement)
299307
this.requestUpdate('server', old);
300308
}
301309

310+
get servers() {
311+
return this._servers;
312+
}
313+
314+
set servers(value) {
315+
const old = this._servers;
316+
/* istanbul ignore if */
317+
if (old === value) {
318+
return;
319+
}
320+
this._servers = value;
321+
this.requestUpdate('servers', old);
322+
}
323+
302324
constructor() {
303325
super();
304326
this._scrollHandler = this._scrollHandler.bind(this);
@@ -961,6 +983,7 @@ export class ApiEndpointDocumentationElement extends AmfHelperMixin(LitElement)
961983
<api-url
962984
.amf="${this.amf}"
963985
.server="${this.server}"
986+
.servers="${this.servers}"
964987
.endpoint="${this.endpoint}"
965988
.apiVersion="${this.apiVersion}"
966989
.baseUri="${this.baseUri}"
@@ -1022,6 +1045,7 @@ export class ApiEndpointDocumentationElement extends AmfHelperMixin(LitElement)
10221045
data-operation-id="${item['@id']}"
10231046
.amf="${amf}"
10241047
.server="${server}"
1048+
.servers="${this.servers}"
10251049
.endpoint="${endpoint}"
10261050
.method="${item}"
10271051
.narrow="${narrow}"

0 commit comments

Comments
 (0)