We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
from typing import Optional @dataclass class VClass: name: Optional[str] = None num: Optional[int] = None @app.route("/") @validate(form=VClass) def test(req, body): print(body.name, type(body.name)) print(body.num, type(body.num))
curl http://localhost/
-----------RESULT--------------- None <class 'str'> None <class 'NoneType'>
The value of body.name is the string "None" , not a NoneType. Is this a bug?
No response
As a script (app.run or Sanic.serve)
app.run
Sanic.serve
Windows
v23.3.0
The text was updated successfully, but these errors were encountered:
I confirm this issue is reproduceable. If no one else had started working on this, I will look into it. But this looks like a sanic extension issue.
Sorry, something went wrong.
@sanic-org/sanic-release-managers Can we transfer this issue to sanic-ext repo?
sanic-ext
ChihweiLHBird
Successfully merging a pull request may close this issue.
Is there an existing issue for this?
Describe the bug
curl http://localhost/
-----------RESULT---------------
None <class 'str'>
None <class 'NoneType'>
The value of body.name is the string "None" , not a NoneType.
Is this a bug?
Code snippet
No response
Expected Behavior
No response
How do you run Sanic?
As a script (
app.run
orSanic.serve
)Operating System
Windows
Sanic Version
v23.3.0
Additional context
No response
The text was updated successfully, but these errors were encountered: