Browse Source

⬆️ Upgrade Pydantic to 0.30 (#384)

* bump pydantic to 0.30

* 📌 Pin Pydantic to 0.30 as 0.31 hasn't been released
pull/385/head
James Kaplan 6 years ago
committed by Sebastián Ramírez
parent
commit
46a986cacf
  1. 2
      Pipfile
  2. 6
      fastapi/openapi/utils.py
  3. 2
      fastapi/utils.py
  4. 2
      pyproject.toml

2
Pipfile

@ -26,7 +26,7 @@ uvicorn = "*"
[packages]
starlette = "==0.12.0"
pydantic = "==0.29.0"
pydantic = "==0.30.0"
databases = {extras = ["sqlite"],version = "*"}
hypercorn = "*"

6
fastapi/openapi/utils.py

@ -100,7 +100,7 @@ def get_openapi_operation_request_body(
if not body_field:
return None
assert isinstance(body_field, Field)
body_schema, _ = field_schema(
body_schema, _, _ = field_schema(
body_field, model_name_map=model_name_map, ref_prefix=REF_PREFIX
)
body_field.schema = cast(Body, body_field.schema)
@ -184,7 +184,7 @@ def get_openapi_path(
), "An additional response must be a dict"
field = route.response_fields.get(additional_status_code)
if field:
response_schema, _ = field_schema(
response_schema, _, _ = field_schema(
field, model_name_map=model_name_map, ref_prefix=REF_PREFIX
)
response.setdefault("content", {}).setdefault(
@ -201,7 +201,7 @@ def get_openapi_path(
response_schema = {"type": "string"}
if lenient_issubclass(route.response_class, JSONResponse):
if route.response_field:
response_schema, _ = field_schema(
response_schema, _, _ = field_schema(
route.response_field,
model_name_map=model_name_map,
ref_prefix=REF_PREFIX,

2
fastapi/utils.py

@ -37,7 +37,7 @@ def get_model_definitions(
) -> Dict[str, Any]:
definitions: Dict[str, Dict] = {}
for model in flat_models:
m_schema, m_definitions = model_process_schema(
m_schema, m_definitions, m_nested_models = model_process_schema(
model, model_name_map=model_name_map, ref_prefix=REF_PREFIX
)
definitions.update(m_definitions)

2
pyproject.toml

@ -20,7 +20,7 @@ classifiers = [
]
requires = [
"starlette >=0.11.1,<=0.12.0",
"pydantic >=0.28,<=0.29.0"
"pydantic >=0.30,<=0.30.0"
]
description-file = "README.md"
requires-python = ">=3.6"

Loading…
Cancel
Save