Add support for Pydantic v1 and above 🎉 (#646)

* Make compatible with pydantic v1

* Remove unused import

* Remove unused ignores

* Update pydantic version

* Fix minor formatting issue

*  Revert removing iterate_in_threadpool

*  Add backwards compatibility with Pydantic 0.32.2

with deprecation warnings

*  Update tests to not break when using Pydantic < 1.0.0

* 📝 Update docs for Pydantic version 1.0.0

* 📌 Update Pydantic range version to support from 0.32.2

* 🎨 Format test imports

*  Add support for Pydantic < 1.2 for populate_validators

*  Add backwards compatibility for Pydantic < 1.2.0 with required fields

* 📌 Relax requirement for Pydantic to < 2.0.0 🎉 🚀

* 💚 Update pragma coverage for older Pydantic versions
This commit is contained in:
dmontagu
2019-11-27 11:32:02 -08:00
committed by Sebastián Ramírez
parent 90a5796b94
commit ab2b86fe2c
66 changed files with 802 additions and 425 deletions

View File

@@ -52,7 +52,7 @@ openapi_schema = {
"properties": {
"username": {"title": "Username", "type": "string"},
"email": {"title": "Email", "type": "string", "format": "email"},
"full_name": {"title": "Full_Name", "type": "string"},
"full_name": {"title": "Full Name", "type": "string"},
},
},
"UserIn": {
@@ -63,7 +63,7 @@ openapi_schema = {
"username": {"title": "Username", "type": "string"},
"password": {"title": "Password", "type": "string"},
"email": {"title": "Email", "type": "string", "format": "email"},
"full_name": {"title": "Full_Name", "type": "string"},
"full_name": {"title": "Full Name", "type": "string"},
},
},
"ValidationError": {

View File

@@ -36,7 +36,7 @@ openapi_schema = {
"parameters": [
{
"required": True,
"schema": {"title": "Item_Id", "type": "string"},
"schema": {"title": "Item Id", "type": "string"},
"name": "item_id",
"in": "path",
}

View File

@@ -35,7 +35,7 @@ openapi_schema = {
"parameters": [
{
"required": True,
"schema": {"title": "Item_Id", "type": "string"},
"schema": {"title": "Item Id", "type": "string"},
"name": "item_id",
"in": "path",
}
@@ -69,7 +69,7 @@ openapi_schema = {
"parameters": [
{
"required": True,
"schema": {"title": "Item_Id", "type": "string"},
"schema": {"title": "Item Id", "type": "string"},
"name": "item_id",
"in": "path",
}

View File

@@ -35,7 +35,7 @@ openapi_schema = {
"parameters": [
{
"required": True,
"schema": {"title": "Item_Id", "type": "string"},
"schema": {"title": "Item Id", "type": "string"},
"name": "item_id",
"in": "path",
}
@@ -69,7 +69,7 @@ openapi_schema = {
"parameters": [
{
"required": True,
"schema": {"title": "Item_Id", "type": "string"},
"schema": {"title": "Item Id", "type": "string"},
"name": "item_id",
"in": "path",
}