swagger-typescript-api
swagger-typescript-api copied to clipboard
BaseUrl option
Hello
I'm missing an option to provide a single BaseUrl for the generated 'httpClient'/'Axios'. As I understood, it would be possible to achieve this by specifying a custom httpClient template. But losing the default template only for setting a specific baseUrl is a pity.
What's your intention regarding such a feature?
A baseUrl
will be generated if it's included in your swagger file: https://github.com/acacode/swagger-typescript-api/blob/7df956c236d1e7fc051658cd7012c8ea22286b44/tests/schemas/v2.0/github-swagger.json#L3-L5
The 'usageSchema' variable lost the 'basePath' attribute during call 'convertSwaggerObject' function. I wanted to use the 'basePath' attribute in the 'apiConfig' variable, but lost it during the template rendering process. Because it uses the usageSchema variable.
Hello @q389491729, what version of swagger schema are you using ?
Hello @q389491729, what version of swagger schema are you using ?
2.0
problem is in the convertSwaggerObject conversion In case openapi is not provided, it creates a usageSchema without the information
swagger2openapi deletes the basePath information after computing the baseUrl You might take this information for originalSchema instead of usageSchema