Open Dreamsorcerer opened 3 years ago
Additionally, mypy thinks this is actually a list, so if I annotate the response with zeep.xsd.valueobjects.ArrayValue
, then I get:
error: No overload variant of "__getitem__" of "list" matches argument type "str" [call-overload]
note: Possible overload variants:
note: def __getitem__(self, int) -> Any
note: def __getitem__(self, slice) -> List[Any]
With code like:
response: zeep.xsd.valueobjects.ArrayValue = await client.service.Foo()
list_of_foo = [e.text for e in response["_value_1"]]
When getting an
ArrayOfString
response back from an operation, I get some weird array object.It says the type is
zeep.objects.Array
, and when iterating through the array, the values are meta keys:The actual values are under
response['_value_1']
, but even this is a list ofElement
s, so to actually get a list of strings, you must:Expected behaviour is to be able to just return
response
or at worstlist(response)
. Note that fixing this would be a breaking change and need a new major release.