Open martinshhh opened 1 year ago
This is extremely important else I have no way to even generate controllers for different environments : test/staging/prod.
ideally the BASE should just be set to ''
and that's it.
Sharing the fix here for visibility https://github.com/nicolas-chaulet/openapi-typescript-codegen/issues/43#issuecomment-1993646116
Not sure if this is already possible, but my idea was to be able to set the BASE field on OpenAPIConfig through the npx command, something like:
npx openapi-typescript-codegen --input api-docs.json --output ./generated --basePath "pets-service"
The reason for this is because whenever the BE makes changes to the API I need to generate the clients again, and when I do this I need to change everytime the OpenAPI.ts BASE field to the one I want. Since I'm using a proxy on my requests, I cannot have the server-endpoint being set there due to CORS, that's why I change it.
This or a way to not make changes on the OpenAPI.ts file whenever we generate the clients.