Closed simonzgx closed 4 years ago
Unfortunately, there is currently no code in bravado that deals with Python reserved keywords. The solution is to use a dict to pass the arguments:
kline_get_kwargs = {
'symbol': 'BTCUSD',
'interval': '1m',
'from': '1572231328',
}
client.Kline.Kline_get(**kline_get_kwargs)
got it, thanks.
When I try to use bravado and Swagger to build REST APIs client, there is a problem that I can't pass a parameter whose name is python keyword.
For instance, I need a variable named "from" that in python is a key word. My code is:
Because
from
is a keyword in python, so there is a syntax error.So I have to add this code in the call function to change the variable name
Can you provide me a batter way to solve the problem? Or fix it?