Skip to content

Commit 7356ac4

Browse files
authored
Merge branch 'master' into form-extra-forbid
2 parents 7a53e7a + 1b06b53 commit 7356ac4

3 files changed

Lines changed: 26 additions & 9 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
if: steps.cache.outputs.cache-hit != 'true'
3838
run: pip install -r requirements-tests.txt
3939
- name: Install Pydantic v2
40-
run: pip install "pydantic>=2.0.2,<3.0.0"
40+
run: pip install --upgrade "pydantic>=2.0.2,<3.0.0"
4141
- name: Lint
4242
run: bash scripts/lint.sh
4343

@@ -79,7 +79,7 @@ jobs:
7979
run: pip install "pydantic>=1.10.0,<2.0.0"
8080
- name: Install Pydantic v2
8181
if: matrix.pydantic-version == 'pydantic-v2'
82-
run: pip install "pydantic>=2.0.2,<3.0.0"
82+
run: pip install --upgrade "pydantic>=2.0.2,<3.0.0"
8383
- run: mkdir coverage
8484
- name: Test
8585
run: bash scripts/test.sh

docs/en/docs/release-notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ hide:
77

88
## Latest Changes
99

10+
### Internal
11+
12+
* ✅ Update internal tests for latest Pydantic, including CI tweaks to install the latest Pydantic. PR [#12147](https://github.com/fastapi/fastapi/pull/12147) by [@tiangolo](https://github.com/tiangolo).
13+
1014
## 0.113.0
1115

1216
Now you can declare form fields with Pydantic models:

tests/test_openapi_examples.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,26 @@ def test_openapi_schema():
155155
"requestBody": {
156156
"content": {
157157
"application/json": {
158-
"schema": {
159-
"allOf": [{"$ref": "#/components/schemas/Item"}],
160-
"title": "Item",
161-
"examples": [
162-
{"data": "Data in Body examples, example1"}
163-
],
164-
},
158+
"schema": IsDict(
159+
{
160+
"$ref": "#/components/schemas/Item",
161+
"examples": [
162+
{"data": "Data in Body examples, example1"}
163+
],
164+
}
165+
)
166+
| IsDict(
167+
{
168+
# TODO: remove when deprecating Pydantic v1
169+
"allOf": [
170+
{"$ref": "#/components/schemas/Item"}
171+
],
172+
"title": "Item",
173+
"examples": [
174+
{"data": "Data in Body examples, example1"}
175+
],
176+
}
177+
),
165178
"examples": {
166179
"Example One": {
167180
"summary": "Example One Summary",

0 commit comments

Comments
 (0)