diff --git a/package-lock.json b/package-lock.json index 23a276d..1e39b6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@api-components/api-endpoint-documentation", - "version": "6.1.0", + "version": "6.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 021f7f4..5913adb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@api-components/api-endpoint-documentation", "description": "A component to generate documentation for a resource from AMF model", - "version": "6.1.0", + "version": "6.1.1", "license": "Apache-2.0", "main": "index.js", "module": "index.js", diff --git a/src/ApiEndpointDocumentationElement.js b/src/ApiEndpointDocumentationElement.js index 0ce7058..f3587a5 100644 --- a/src/ApiEndpointDocumentationElement.js +++ b/src/ApiEndpointDocumentationElement.js @@ -194,6 +194,14 @@ export class ApiEndpointDocumentationElement extends AmfHelperMixin(LitElement) * If true, the server selector custom base URI option is rendered */ allowCustomBaseUri: { type: Boolean }, + /** + * Adds a servers to async API + * + * @param {string} url - The URL of the server. + * @param {object} [description] - An object containing a string `description` property. + */ + servers: {type:Array}, + _servers: {type:Array}, }; } @@ -299,6 +307,20 @@ export class ApiEndpointDocumentationElement extends AmfHelperMixin(LitElement) this.requestUpdate('server', old); } + get servers() { + return this._servers; + } + + set servers(value) { + const old = this._servers; + /* istanbul ignore if */ + if (old === value) { + return; + } + this._servers = value; + this.requestUpdate('servers', old); + } + constructor() { super(); this._scrollHandler = this._scrollHandler.bind(this); @@ -961,6 +983,7 @@ export class ApiEndpointDocumentationElement extends AmfHelperMixin(LitElement)