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

@@ -62,15 +62,15 @@ openapi_schema = {
"type": "object",
"properties": {
"grant_type": {
"title": "Grant_Type",
"title": "Grant Type",
"pattern": "password",
"type": "string",
},
"username": {"title": "Username", "type": "string"},
"password": {"title": "Password", "type": "string"},
"scope": {"title": "Scope", "type": "string", "default": ""},
"client_id": {"title": "Client_Id", "type": "string"},
"client_secret": {"title": "Client_Secret", "type": "string"},
"client_id": {"title": "Client Id", "type": "string"},
"client_secret": {"title": "Client Secret", "type": "string"},
},
},
"ValidationError": {

View File

@@ -103,7 +103,7 @@ openapi_schema = {
"properties": {
"username": {"title": "Username", "type": "string"},
"email": {"title": "Email", "type": "string"},
"full_name": {"title": "Full_Name", "type": "string"},
"full_name": {"title": "Full Name", "type": "string"},
"disabled": {"title": "Disabled", "type": "boolean"},
},
},
@@ -112,8 +112,8 @@ openapi_schema = {
"required": ["access_token", "token_type"],
"type": "object",
"properties": {
"access_token": {"title": "Access_Token", "type": "string"},
"token_type": {"title": "Token_Type", "type": "string"},
"access_token": {"title": "Access Token", "type": "string"},
"token_type": {"title": "Token Type", "type": "string"},
},
},
"Body_login_for_access_token_token_post": {
@@ -122,15 +122,15 @@ openapi_schema = {
"type": "object",
"properties": {
"grant_type": {
"title": "Grant_Type",
"title": "Grant Type",
"pattern": "password",
"type": "string",
},
"username": {"title": "Username", "type": "string"},
"password": {"title": "Password", "type": "string"},
"scope": {"title": "Scope", "type": "string", "default": ""},
"client_id": {"title": "Client_Id", "type": "string"},
"client_secret": {"title": "Client_Secret", "type": "string"},
"client_id": {"title": "Client Id", "type": "string"},
"client_secret": {"title": "Client Secret", "type": "string"},
},
},
"ValidationError": {