From 7175ff314c103b7f4f19ac667b60d0264c406098 Mon Sep 17 00:00:00 2001 From: leandrogilcarrano Date: Fri, 3 May 2024 12:19:45 -0300 Subject: [PATCH 1/4] fix(W-15607551): bindings error --- src/ApiBodyDocumentElement.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/ApiBodyDocumentElement.js b/src/ApiBodyDocumentElement.js index a8937bd..2c5203b 100644 --- a/src/ApiBodyDocumentElement.js +++ b/src/ApiBodyDocumentElement.js @@ -270,8 +270,8 @@ export class ApiBodyDocumentElement extends AmfHelperMixin(LitElement) { try { this._bindings = value?.map((item) => ({ - key: item[messageKey][0][descriptionKey][0]['@value'], - dataType: item[messageKey][0][dataTypeKey] ? this._getDataType(item[messageKey][0][dataTypeKey][0]['@id']) : 'any', // integer, number, long, float, double, boolean + key: item[messageKey] ? item[messageKey][0][descriptionKey][0]['@value']: false, + dataType: item[messageKey] && item[messageKey][0][dataTypeKey] ? this._getDataType(item[messageKey][0][dataTypeKey][0]['@id']) : 'any', // integer, number, long, float, double, boolean bindingType: this._getValue(item, typeKey), // kafka, AMQP, etc })) } catch(e) { @@ -617,6 +617,27 @@ export class ApiBodyDocumentElement extends AmfHelperMixin(LitElement) {
` : ''} + ${this._isAsyncAPI(this.amf) && !!this.bindings ? + html`` + : ''} + ${_isObject ? html` Date: Fri, 3 May 2024 12:20:13 -0300 Subject: [PATCH 2/4] 4.4.10 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 072a404..83caf84 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@api-components/api-body-document", - "version": "4.4.9", + "version": "4.4.10", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 206d324..2309c49 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@api-components/api-body-document", "description": "A component to render HTTP method body documentation based on AMF model", - "version": "4.4.9", + "version": "4.4.10", "license": "Apache-2.0", "main": "index.js", "module": "index.js", From 884d18c9ec2e29c790ffa93665e3ccb57b8d6914 Mon Sep 17 00:00:00 2001 From: leandrogilcarrano Date: Fri, 3 May 2024 14:51:37 -0300 Subject: [PATCH 3/4] fix(W-15607551): bindings error --- src/ApiBodyDocumentElement.js | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/ApiBodyDocumentElement.js b/src/ApiBodyDocumentElement.js index 2c5203b..d3a8ba8 100644 --- a/src/ApiBodyDocumentElement.js +++ b/src/ApiBodyDocumentElement.js @@ -617,27 +617,6 @@ export class ApiBodyDocumentElement extends AmfHelperMixin(LitElement) {
` : ''} - ${this._isAsyncAPI(this.amf) && !!this.bindings ? - html`
    - ${this.bindings.map(item => html`
  • -

    - - ${item.bindingType} -

    - ${item.key!==false ? - html ` -
    - - ${item.key} - ${item.dataType} -
    - ` - : ''} - -
  • `)} -
` - : ''} - ${_isObject ? html` Date: Fri, 3 May 2024 16:10:13 -0300 Subject: [PATCH 4/4] add bindings --- src/ApiBodyDocumentElement.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/ApiBodyDocumentElement.js b/src/ApiBodyDocumentElement.js index d3a8ba8..2c5203b 100644 --- a/src/ApiBodyDocumentElement.js +++ b/src/ApiBodyDocumentElement.js @@ -617,6 +617,27 @@ export class ApiBodyDocumentElement extends AmfHelperMixin(LitElement) {
` : ''} + ${this._isAsyncAPI(this.amf) && !!this.bindings ? + html`
    + ${this.bindings.map(item => html`
  • +

    + + ${item.bindingType} +

    + ${item.key!==false ? + html ` +
    + + ${item.key} + ${item.dataType} +
    + ` + : ''} + +
  • `)} +
` + : ''} + ${_isObject ? html`