Skip to content

post() does not support arrays #90

@marshall-ucsd

Description

@marshall-ucsd

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions