Skip to content

Commit

Permalink
Merge branch 'main' into feat/subprocess-test-client
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobCoffee authored Aug 12, 2024
2 parents 0c4a4d5 + f80b4d3 commit cd6443e
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 10 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,15 @@
"contributions": [
"code"
]
},
{
"login": "Zimzozaur",
"name": "Simon Joseph",
"avatar_url": "https://avatars.githubusercontent.com/u/106471045?v=4",
"profile": "https://github.com/Zimzozaur",
"contributions": [
"doc"
]
}
],
"contributorsPerLine": 7,
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,8 @@ jobs:
run: pdm run make docs-linkcheck

- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: echo $PR_NUMBER > .pr_number
run: |
echo "${{ github.event.number }}" > .pr_number
- name: Upload artifact
uses: actions/upload-artifact@v3
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ jobs:
path: docs-preview
name: docs-preview

- name: Set PR number
run: echo "PR_NUMBER=$(cat docs-preview/.pr_number)" >> $GITHUB_ENV
- name: Validate and set PR number
run: |
PR_NUMBER=$(cat docs-preview/.pr_number)
if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
echo "Invalid PR number: $PR_NUMBER"
exit 1
fi
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
- name: Deploy docs preview
uses: JamesIves/github-pages-deploy-action@v4
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ see [the contribution guide](CONTRIBUTING.rst).
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Anu-cool-007"><img src="https://avatars.githubusercontent.com/u/16525919?v=4?s=100" width="100px;" alt="Anuranjan Srivastava"/><br /><sub><b>Anuranjan Srivastava</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/commits?author=Anu-cool-007" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Zimzozaur"><img src="https://avatars.githubusercontent.com/u/106471045?v=4?s=100" width="100px;" alt="Simon Joseph"/><br /><sub><b>Simon Joseph</b></sub></a><br /><a href="https://github.com/litestar-org/litestar/commits?author=Zimzozaur" title="Documentation">📖</a></td>
</tr>
</tbody>
</table>
Expand Down
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])
6 changes: 3 additions & 3 deletions docs/migration/flask.rst
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ Request methods
+---------------------------------+-------------------------------------------------------------------------------------------------------+
| ``request.environ`` | ``request.scope`` |
+---------------------------------+-------------------------------------------------------------------------------------------------------+
| ``request.files`` | Use ```UploadFile`` <usage/4-request-data/#file-uploads>`__ |
| ``request.files`` | Use ```UploadFile`` <usage/requests/file-uploads>`__ |
+---------------------------------+-------------------------------------------------------------------------------------------------------+
| ``request.form`` | ``request.form()``, prefer ```Body`` <usage/4-request-data/#specifying-a-content-type>`__ |
| ``request.form`` | ``request.form()``, prefer ```Body`` <usage/requests/content-type>`__ |
+---------------------------------+-------------------------------------------------------------------------------------------------------+
| ``request.get_json`` | ``request.json()``, prefer the ```data keyword argument`` <usage/4-request-data/#request-body>`__ |
| ``request.get_json`` | ``request.json()``, prefer the ```data keyword argument`` <usage/requests/request-body>`__ |
+---------------------------------+-------------------------------------------------------------------------------------------------------+
| ``request.headers`` | ``request.headers`` |
+---------------------------------+-------------------------------------------------------------------------------------------------------+
Expand Down

0 comments on commit cd6443e

Please sign in to comment.