Skip to content

Protocols body and data attributes docstrings fix #829

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

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions openapi_core/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ class Request(BaseRequest, Protocol):
parameters
A RequestParameters object. Needs to supports path attribute setter
to write resolved path parameters.
body
The request body, as string.
content_type
The content type with parameters (eg, charset, boundary etc.)
and always lowercase.
body
The request body, as bytes (None if not provided).
"""

@property
Expand All @@ -70,11 +70,11 @@ class WebhookRequest(BaseRequest, Protocol):
parameters
A RequestParameters object. Needs to supports path attribute setter
to write resolved path parameters.
body
The request body, as string.
content_type
The content type with parameters (eg, charset, boundary etc.)
and always lowercase.
body
The request body, as bytes (None if not provided).
"""

@property
Expand Down Expand Up @@ -103,19 +103,16 @@ class Response(Protocol):
"""Response protocol.

Attributes:
data
The response body, as string.
status_code
The status code as integer.
headers
Response headers as Headers.
content_type
The content type with parameters and always lowercase.
data
The response body, as bytes (None if not provided).
"""

@property
def data(self) -> Optional[bytes]: ...

@property
def status_code(self) -> int: ...

Expand All @@ -124,3 +121,6 @@ def content_type(self) -> str: ...

@property
def headers(self) -> Mapping[str, Any]: ...

@property
def data(self) -> Optional[bytes]: ...