Skip to content

Commit b1919a1

Browse files
Merge pull request #88 from advanced-rest-client/fix/W-15607557/server-name
Fix/w 15607557/server name
2 parents f954f37 + 9c9af40 commit b1919a1

File tree

4 files changed

+9
-48
lines changed

4 files changed

+9
-48
lines changed

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@api-components/api-method-documentation",
33
"description": "A HTTP method documentation build from AMF model",
4-
"version": "5.2.22",
4+
"version": "5.2.23",
55
"license": "Apache-2.0",
66
"main": "index.js",
77
"module": "index.js",

src/ApiMethodDocumentation.js

+2-28
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,7 @@ export class ApiMethodDocumentation extends AmfHelperMixin(LitElement) {
231231
* Bindings for the type document.
232232
* This is a map of the type name to the binding name.
233233
*/
234-
bindings: {type: Array},
235-
/**
236-
* Adds a servers to async API
237-
*
238-
* @param {string} url - The URL of the server.
239-
* @param {object} [description] - An object containing a string `description` property.
240-
*/
241-
servers: {type:Array},
242-
_servers: {type:Array},
234+
bindings: {type: Array}
243235
};
244236
}
245237

@@ -343,21 +335,6 @@ export class ApiMethodDocumentation extends AmfHelperMixin(LitElement) {
343335
this._processServerInfo();
344336
}
345337

346-
get servers() {
347-
return this._servers;
348-
}
349-
350-
set servers(value) {
351-
352-
const old = this._servers;
353-
/* istanbul ignore if */
354-
if (old === value) {
355-
return;
356-
}
357-
this._servers = value;
358-
this.requestUpdate('servers', old);
359-
}
360-
361338
get _titleHidden() {
362339
if (!this.noTryIt) {
363340
return false;
@@ -920,7 +897,6 @@ export class ApiMethodDocumentation extends AmfHelperMixin(LitElement) {
920897
<api-url
921898
.amf="${this.amf}"
922899
.server="${this.server}"
923-
.servers="${this.servers}"
924900
.endpoint="${this.endpoint}"
925901
.apiVersion="${this.apiVersion}"
926902
.baseUri="${this.baseUri}"
@@ -1248,8 +1224,7 @@ export class ApiMethodDocumentation extends AmfHelperMixin(LitElement) {
12481224
const {
12491225
amf,
12501226
compatibility,
1251-
graph,
1252-
servers
1227+
graph
12531228
} = this;
12541229
return html`
12551230
<div class="callback-section">
@@ -1258,7 +1233,6 @@ export class ApiMethodDocumentation extends AmfHelperMixin(LitElement) {
12581233
.amf="${amf}"
12591234
.method="${method}"
12601235
.endpoint="${endpoint}"
1261-
.servers="${servers}"
12621236
?compatibility="${compatibility}"
12631237
?graph="${graph}"
12641238
noTryit

src/ApiUrl.js

+4-17
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ export class ApiUrl extends AmfHelperMixin(LitElement) {
5959
* Optional, operation id that is render only for async api
6060
*/
6161
operationId:{type: String},
62-
/**
63-
* Adds a servers to async API
64-
*
65-
* @param {string} url - The URL of the server.
66-
* @param {object} [description] - An object containing a string `description` property.
67-
*/
68-
servers: {type:Array},
69-
_servers: {type:Array},
7062
_url: { type: String },
7163
_method: { type: String },
7264
_protocol: { type: String },
@@ -126,16 +118,11 @@ export class ApiUrl extends AmfHelperMixin(LitElement) {
126118
}
127119

128120
get servers() {
129-
return this._servers;
130-
}
131-
132-
set servers(value) {
133-
const old = this._servers;
134-
if (old === value) {
135-
return;
121+
let endpointId
122+
if(this.endpoint){
123+
endpointId = this.endpoint["@id"]
136124
}
137-
this._servers = value;
138-
this.requestUpdate('servers', old);
125+
return this._getServers({ endpointId });
139126
}
140127

141128
get endpoint() {

0 commit comments

Comments
 (0)