swagger-js icon indicating copy to clipboard operation
swagger-js copied to clipboard

Allow passing baseURL to Swagger.exeute method.

Open sauravazad opened this issue 1 year ago • 2 comments

Content & configuration

Swagger-Client usage:

SwaggerClient.execute({
 baseURL: 'someURL'
})

Is your feature request related to a problem?

baseURL is computed every time when an execute is invoked . https://github.com/swagger-api/swagger-js/blob/ee7fdd67a1369cdb90056ad96751ac97c9c31131/src/execute/index.js#L313

Please have a look at below flame chart . Building the URL consumes almost 75% of execution time for the executeClient method . image

Describe the solution you'd like

If SwaggerClient.execute() were to accept a baseURL , and use it if provided instead of building it , It would help in improving the performance and execution time .

Please let me know if this added support is acceptable . If so, I will raise a PR to add the support.

sauravazad avatar May 27 '24 04:05 sauravazad

@char0n

Any comments or thought on the above proposal ?

sauravazad avatar Jun 05 '24 16:06 sauravazad

Hi @sauravazad,

The proposal is reasonable. We're gonna go for it. I'll tend the the PR ASAP.

Thank you!

char0n avatar Oct 18 '24 12:10 char0n

Addressed in https://github.com/swagger-api/swagger-js/pull/3538

char0n avatar Nov 07 '24 11:11 char0n

Released as https://github.com/swagger-api/swagger-js/releases/tag/v3.31.0

char0n avatar Nov 07 '24 11:11 char0n