How should you specify host and port in the python client library auto-generated by swagger-codegen
?
The only documentation that I found is here.
Bit of an old one but since this is where I landed first when searching, I'll provide my solution:
configuration = swagger_client.Configuration()
configuration.host = 'http://127.0.0.1:8000'
api_client = swagger_client.ApiClient(configuration=configuration)
api_instance = swagger_client.DefaultApi(api_client=api_client)
But since the configuration gets hard coded, for our project I'll likely end up having a different client for different environments (staging, prod etc).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With