Open fbl100 opened 2 years ago
I see the same issue right now. I think fixing it would be trivial. It will be faster to contribute that rather than wait for core team IMHO CC @dimakis
I tend to agree, but won't have the bandwidth for a fix until mid Sept. I wrote the issue so that it doesn't get forgotten about and would be happy to fix when I have time. The workaround is easy enough for now.
I just ran into this bug today. I see this bit of code and it is clear that setting access_token during the init of a Configuration object will be overwritten to 'None'. I am not familiar enough with the codebase to know the correct fix for this, but it should be simple.
self.access_token = access_token
"""Access token
"""
{{#hasHttpSignatureMethods}}
if signing_info is not None:
signing_info.host = host
self.signing_info = signing_info
"""The HTTP signing configuration
"""
{{/hasHttpSignatureMethods}}
{{#hasOAuthMethods}}
self.access_token = None
"""access token for OAuth/Bearer
"""
{{/hasOAuthMethods}}
Our current workaround is to explicitly set the token in the override headers of each request.
Setting the token statically in the configuration would not be sufficient for us, as the token expire frequently. I.e. for the token to be set in the API client configuration, we would need a lazy evaluation, i.e. some sort of Promise to be set, such that the actual token value is only obtained once the request is made, such that in case a token refresh can be triggered before using the token.
This ticket might be related to:
Bug Report Checklist
Description
This is for the
python-experimental
client generator.When working with a 'bearer' access token, I am unable to set the 'access_token' property in the Configuration() initializer. Instead, I have to do this:
ideally I would be able to do this:
openapi-generator version
latest master (8/30/2022)
OpenAPI declaration file content or url
N/A
Related issues/PRs
Suggest a fix