You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, the operation methods attached to the client expect *args for path parameters and **kwargs for query parameters, while there are keyword arguments body_ and headers_ for the respective types of operation parameters. One problem here is that there is no way to update other parameter types (specifically cookies), but also the number of "special" kwargs seems a bit excessive.
Describe the solution you'd like
Instead of separate kwargs for different types we could define a single argument, named extra_, which would accept an arbitrary dictionary. Internally, the method would extract any values that match special keys (namely headers, cookies and body, but also possibly files and others). The *args and **kwargs would remain reserved for path and query parameters, respectively.
Additional context
As part of this enhancement we could also allow for a kwarg value to be an iterable (collections.abc.Iterable), in which case it would be applied to the request by sending the same parameter multiple times, i.e.:
client.foo(bar=[1,2,3])
would send the request as:
/foo?bar=1&bar=2&bar=3
The text was updated successfully, but these errors were encountered:
The issue described under "Additional context" actually only needs the activation of the doseq argument on urlencode in ClientOpenAPIRequest.url. A few tests would certainly be helpful.
Is your feature request related to a problem? Please describe.
Currently, the operation methods attached to the client expect
*args
for path parameters and**kwargs
for query parameters, while there are keyword argumentsbody_
andheaders_
for the respective types of operation parameters. One problem here is that there is no way to update other parameter types (specifically cookies), but also the number of "special" kwargs seems a bit excessive.Describe the solution you'd like
Instead of separate kwargs for different types we could define a single argument, named
extra_
, which would accept an arbitrary dictionary. Internally, the method would extract any values that match special keys (namelyheaders
,cookies
andbody
, but also possiblyfiles
and others). The*args
and**kwargs
would remain reserved for path and query parameters, respectively.Additional context
As part of this enhancement we could also allow for a kwarg value to be an iterable (
collections.abc.Iterable
), in which case it would be applied to the request by sending the same parameter multiple times, i.e.:would send the request as:
The text was updated successfully, but these errors were encountered: