Skip to content

Commit

Permalink
Merge pull request #40 from advanced-rest-client/feat/W-15607551/serv…
Browse files Browse the repository at this point in the history
…ers-name

feat(W-15607551): server name
  • Loading branch information
leandrogilcarrano authored May 3, 2024
2 parents 04b9376 + 4bd62ef commit a1498c7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
24 changes: 24 additions & 0 deletions src/ApiEndpointDocumentationElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -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},
};
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -961,6 +983,7 @@ export class ApiEndpointDocumentationElement extends AmfHelperMixin(LitElement)
<api-url
.amf="${this.amf}"
.server="${this.server}"
.servers="${this.servers}"
.endpoint="${this.endpoint}"
.apiVersion="${this.apiVersion}"
.baseUri="${this.baseUri}"
Expand Down Expand Up @@ -1022,6 +1045,7 @@ export class ApiEndpointDocumentationElement extends AmfHelperMixin(LitElement)
data-operation-id="${item['@id']}"
.amf="${amf}"
.server="${server}"
.servers="${this.servers}"
.endpoint="${endpoint}"
.method="${item}"
.narrow="${narrow}"
Expand Down

0 comments on commit a1498c7

Please sign in to comment.