Why is Response.parsed Optional? #528
-
I generated a Python client and the @attr.s(auto_attribs=True)
class Response(Generic[T]):
"""A response from an endpoint"""
status_code: int
content: bytes
headers: MutableMapping[str, str]
parsed: Optional[T] I was curious. What is the situation where |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
It seems as if having incorrect authentication can return |
Beta Was this translation helpful? Give feedback.
-
It will be None anytime there is no response. If there's a schema for an error (e.g. 401) then that data should be parsed, so it's not everytime there's an error, just when there's no response. |
Beta Was this translation helpful? Give feedback.
It will be None anytime there is no response. If there's a schema for an error (e.g. 401) then that data should be parsed, so it's not everytime there's an error, just when there's no response.