Hi,
I wonder if there is an easy way of having a configurable BASE_PATH as I need to switch between different hosts depending on the current environment (production and dev). This should be a common scenario in my opinion.
I realize that there are (at least) 2 solutions:
host and/or basePath fields in the definition fileBut I believe both options are far from ideal.
Configuring the base url only once in centralized fashion would be less error-prone and much more convenient.
Thanks for any suggestions!
I think the following PR is related to your suggestion:
Oh... thx! Will definitely have a look at it!
@wing328 this is still a issue in the typescript-fetch templates.
I found no way to override the base-path for all APIs, instead you currently need to configure each API in each usage on their own.
Is there any plan to change this?
@zwenza the configuration object also contains the basePath parameter: https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/typescript-fetch/configuration.mustache#L46
Is that what you're looking for?
but can i would need to pass this for each API i create in the constructor if i understand that correct?
It would work if the template provides a function to override the base path. I tried it local and it would work, but i don't know if that's the best solution.
Could make a PR if you also think that it would be a good idea to provide a function.
Most helpful comment
but can i would need to pass this for each API i create in the constructor if i understand that correct?
It would work if the template provides a function to override the base path. I tried it local and it would work, but i don't know if that's the best solution.
Could make a PR if you also think that it would be a good idea to provide a function.