Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

post() does not support arrays #90

Open
marshall-ucsd opened this issue Jul 9, 2023 · 0 comments
Open

post() does not support arrays #90

marshall-ucsd opened this issue Jul 9, 2023 · 0 comments

Comments

@marshall-ucsd
Copy link

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:

  1. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant