mirror of https://github.com/tiangolo/fastapi.git
✅ Update internal tests for latest Pydantic, including CI tweaks to install the latest Pydantic (#12147)
This commit is contained in:
parent
d86f660302
commit
c411b81c29
|
|
@ -37,7 +37,7 @@ jobs:
|
||||||
if: steps.cache.outputs.cache-hit != 'true'
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
run: pip install -r requirements-tests.txt
|
run: pip install -r requirements-tests.txt
|
||||||
- name: Install Pydantic v2
|
- name: Install Pydantic v2
|
||||||
run: pip install "pydantic>=2.0.2,<3.0.0"
|
run: pip install --upgrade "pydantic>=2.0.2,<3.0.0"
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: bash scripts/lint.sh
|
run: bash scripts/lint.sh
|
||||||
|
|
||||||
|
|
@ -79,7 +79,7 @@ jobs:
|
||||||
run: pip install "pydantic>=1.10.0,<2.0.0"
|
run: pip install "pydantic>=1.10.0,<2.0.0"
|
||||||
- name: Install Pydantic v2
|
- name: Install Pydantic v2
|
||||||
if: matrix.pydantic-version == 'pydantic-v2'
|
if: matrix.pydantic-version == 'pydantic-v2'
|
||||||
run: pip install "pydantic>=2.0.2,<3.0.0"
|
run: pip install --upgrade "pydantic>=2.0.2,<3.0.0"
|
||||||
- run: mkdir coverage
|
- run: mkdir coverage
|
||||||
- name: Test
|
- name: Test
|
||||||
run: bash scripts/test.sh
|
run: bash scripts/test.sh
|
||||||
|
|
|
||||||
|
|
@ -155,13 +155,26 @@ def test_openapi_schema():
|
||||||
"requestBody": {
|
"requestBody": {
|
||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": IsDict(
|
||||||
"allOf": [{"$ref": "#/components/schemas/Item"}],
|
{
|
||||||
"title": "Item",
|
"$ref": "#/components/schemas/Item",
|
||||||
"examples": [
|
"examples": [
|
||||||
{"data": "Data in Body examples, example1"}
|
{"data": "Data in Body examples, example1"}
|
||||||
],
|
],
|
||||||
},
|
}
|
||||||
|
)
|
||||||
|
| IsDict(
|
||||||
|
{
|
||||||
|
# TODO: remove when deprecating Pydantic v1
|
||||||
|
"allOf": [
|
||||||
|
{"$ref": "#/components/schemas/Item"}
|
||||||
|
],
|
||||||
|
"title": "Item",
|
||||||
|
"examples": [
|
||||||
|
{"data": "Data in Body examples, example1"}
|
||||||
|
],
|
||||||
|
}
|
||||||
|
),
|
||||||
"examples": {
|
"examples": {
|
||||||
"Example One": {
|
"Example One": {
|
||||||
"summary": "Example One Summary",
|
"summary": "Example One Summary",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue