Skip to content

Commit

Permalink
Update core.py
Browse files Browse the repository at this point in the history
removed useless comments
  • Loading branch information
yctomwang authored Oct 29, 2023
1 parent 6e25a68 commit 0e068b6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions flask_pydantic/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def validate_path_params(func: Callable, kwargs: dict) -> Tuple[dict, list]:


def get_body_dict(**params):
data = request.get_json(**params) #what does request.get_json
data = request.get_json(**params)
if data is None and params.get("silent"):
return {}
return data
Expand Down Expand Up @@ -184,7 +184,6 @@ def wrapper(*args, **kwargs):
body_params = get_body_dict(**(get_json_params or {}))
if "RootModel" in body_model.model_fields or 'root' in body_model.__annotations__:
try:
# Try to instantiate the model
b = body_model(root=body_params).root
except ValidationError as ve:
err["body_params"] = ve.errors()
Expand Down

0 comments on commit 0e068b6

Please sign in to comment.