Skip to content

Commit

Permalink
Merge pull request #59 from advanced-rest-client/fix/servers
Browse files Browse the repository at this point in the history
reverse changes
  • Loading branch information
leandrogilcarrano authored May 6, 2024
2 parents 472d291 + 537892a commit a4b81fa
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/ApiDocumentationElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,16 +403,12 @@ export class ApiDocumentationElement extends EventsTargetMixin(AmfHelperMixin(Li
let methodId;
if (selectedType === 'method') {
endpointId = eid;
if(this._isAsyncAPI(this.amf) && this._endpoint){
endpointId = this._endpoint['@id'];
}
methodId = mid;
} else {
endpointId = mid;
}

const servers = this._getServers({ endpointId, methodId });
this._servers = this._ensureArray(servers)

if (!servers || !servers.length) {
return null;
Expand Down Expand Up @@ -1185,7 +1181,7 @@ export class ApiDocumentationElement extends EventsTargetMixin(AmfHelperMixin(Li
}

_methodTemplate() {
const { amf, _docsModel, narrow, compatibility, _endpoint, selected, noTryIt, graph, noBottomNavigation, server, _servers } = this;
const { amf, _docsModel, narrow, compatibility, _endpoint, selected, noTryIt, graph, noBottomNavigation, server } = this;
const prev = this._computeMethodPrevious(amf, selected);
const next = this._computeMethodNext(amf, selected);

Expand All @@ -1195,7 +1191,6 @@ export class ApiDocumentationElement extends EventsTargetMixin(AmfHelperMixin(Li
.compatibility="${compatibility}"
.endpoint="${_endpoint}"
.server="${server}"
.servers="${_servers}"
.method="${_docsModel}"
.previous="${prev}"
.next="${next}"
Expand All @@ -1214,7 +1209,7 @@ export class ApiDocumentationElement extends EventsTargetMixin(AmfHelperMixin(Li
}

_inlineEndpointTemplate() {
const { amf, _docsModel, narrow, compatibility, outlined, selected, scrollTarget, redirectUri, noUrlEditor, graph, noBottomNavigation, server, _servers } = this;
const { amf, _docsModel, narrow, compatibility, outlined, selected, scrollTarget, redirectUri, noUrlEditor, graph, noBottomNavigation, server } = this;
const prev = this._computeEndpointPrevious(amf, selected, true);
const next = this._computeEndpointNext(amf, selected, true);

Expand All @@ -1225,7 +1220,6 @@ export class ApiDocumentationElement extends EventsTargetMixin(AmfHelperMixin(Li
.outlined="${outlined}"
.selected="${selected}"
.server="${server}"
.servers="${_servers}"
.endpoint="${_docsModel}"
.previous="${prev}"
.next="${next}"
Expand All @@ -1240,7 +1234,7 @@ export class ApiDocumentationElement extends EventsTargetMixin(AmfHelperMixin(Li
}

_simpleEndpointTemplate() {
const { amf, _docsModel, narrow, compatibility, selected, graph, noBottomNavigation, server, _servers } = this;
const { amf, _docsModel, narrow, compatibility, selected, graph, noBottomNavigation, server } = this;
const prev = this._computeEndpointPrevious(amf, selected);
const next = this._computeEndpointNext(amf, selected);

Expand All @@ -1249,7 +1243,6 @@ export class ApiDocumentationElement extends EventsTargetMixin(AmfHelperMixin(Li
.narrow="${narrow}"
.compatibility="${compatibility}"
.server="${server}"
.servers="${_servers}"
.selected="${selected}"
.endpoint="${_docsModel}"
.previous="${prev}"
Expand Down

0 comments on commit a4b81fa

Please sign in to comment.