Skip to content

Commit

Permalink
fix: Small docs update. (#3661)
Browse files Browse the repository at this point in the history
* Update path_parameters_1.py

Update

* Update header_and_cookie_parameters.py

Update

---------

Co-authored-by: Jacob Coffee <jacob@z7x.org>
  • Loading branch information
Zimzozaur and JacobCoffee authored Aug 12, 2024
1 parent 09f6039 commit f80b4d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/examples/parameters/header_and_cookie_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async def get_user(
) -> User:
if token != VALID_TOKEN or cookie != VALID_COOKIE_VALUE:
raise NotAuthorizedException
return User.parse_obj(USER_DB[user_id])
return User.model_validate(USER_DB[user_id])


app = Litestar(route_handlers=[get_user])
2 changes: 1 addition & 1 deletion docs/examples/parameters/path_parameters_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class User(BaseModel):

@get("/user/{user_id:int}", sync_to_thread=False)
def get_user(user_id: int) -> User:
return User.parse_obj(USER_DB[user_id])
return User.model_validate(USER_DB[user_id])


app = Litestar(route_handlers=[get_user])

0 comments on commit f80b4d3

Please sign in to comment.