Skip to content

Commit

Permalink
Fixed small things from coderabbit review
Browse files Browse the repository at this point in the history
  • Loading branch information
Seluj78 committed Sep 22, 2024
1 parent ef9babd commit 47bf4a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flask_utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _is_allow_empty(value: Any, type_hint: Type) -> bool: # type: ignore
.. versionadded:: 0.2.0
"""
if not value:
# Check if type is explicitly Optional or allow_empty is True
# Check if type is explicitly Optional
if _is_optional(type_hint):
return True
return False
Expand Down
4 changes: 2 additions & 2 deletions tests/test_validate_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ def optional(name: str, age: Optional[int]):
return "OK", 200

def test_valid_request(self, client):
# response = client.post("/optional", json={"name": "John", "age": 25})
# assert response.status_code == 200
response = client.post("/optional", json={"name": "John", "age": 25})
assert response.status_code == 200

response = client.post("/optional", json={"name": "John"})
assert response.status_code == 200
Expand Down

0 comments on commit 47bf4a3

Please sign in to comment.