From 3d2755ec3a8d3fa52e629eddc32f3b7f71edfd58 Mon Sep 17 00:00:00 2001 From: NazaQuintero Date: Thu, 25 Apr 2024 14:32:13 -0300 Subject: [PATCH] _getValue and _getAmfKey, asyncApi condition --- src/ApiSummary.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ApiSummary.js b/src/ApiSummary.js index 56b4edf..201daa1 100644 --- a/src/ApiSummary.js +++ b/src/ApiSummary.js @@ -422,7 +422,6 @@ export class ApiSummary extends AmfHelperMixin(LitElement) { const uri = this._computeBaseUri(server, baseUri, protocols); const description = this._computeDescription(server); const serverTagsTemplate = this._serverTagsTemplate(server); - console.log("server: ", server); return html`
  • ${uri} ${serverTagsTemplate} `#${t["core:name"][0]["@value"]} `); + const isAsyncApi = this._isAsyncAPI(this.amf); + if (!isAsyncApi) { + return html``; + } + const tagsKey = this._getAmfKey(this.ns.aml.vocabularies.apiContract.tags); + const tags = server[tagsKey]; + const tagsNames = tags?.map( + (tagName) => + `#${this._getValue(tagName, this.ns.aml.vocabularies.core.name)} ` + ); return tagsNames?.map((t) => html`

    ${t}

    `); }