api-client
api-client copied to clipboard
post() does not support arrays
Python 3.11, api-client 1.3.1
I am accessing a REST API where the POST data is an array of object (i.e., Sequence[dict]) - the signature of RequestStrategy.post()
only accepts dict (object), which generates type-mismatch errors in IDEs such as PyCharm:
Expected type 'dict', got 'Sequence[dict]' instead
To Reproduce Steps to reproduce the behavior:
- Call
post()
with a list (e.g.,[]
)
Expected behavior Arrays are valid JSON so they should be accepted in the method signature.
Typing in Python is more advisory than enforced so this does not impact execution but can create confusion with any type-checking.