Skip to content

Confusion with the Request.body type #828

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

Closed
p1c2u opened this issue Apr 10, 2024 Discussed in #824 · 0 comments · Fixed by #829
Closed

Confusion with the Request.body type #828

p1c2u opened this issue Apr 10, 2024 Discussed in #824 · 0 comments · Fixed by #829
Labels
area/contrib Indicates an issue on contrib area. kind/bug/confirmed kind/bug Indicates an issue

Comments

@p1c2u
Copy link
Collaborator

p1c2u commented Apr 10, 2024

Discussed in #824

Originally posted by berislavlopac April 6, 2024
On this line:

def body(self) -> Optional[bytes]: ...

the type of the BaseRequest.body property is defined as Optional[bytes]; however, the docstring of the Request protocol (which inherits body from BaseRequest) says:

    body
       The request body, as string.

I'm currently having some issue with the validation, but it's not clear which direction should I go with the solution -- should body be bytes or str? Have I missed something? Thank you!

@p1c2u p1c2u added kind/bug/confirmed area/contrib Indicates an issue on contrib area. kind/bug Indicates an issue labels Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/contrib Indicates an issue on contrib area. kind/bug/confirmed kind/bug Indicates an issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant