fix bug we cannot use optional params
This commit is contained in:
11
aiohttp_pydantic/utils.py
Normal file
11
aiohttp_pydantic/utils.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
def is_pydantic_base_model(obj):
|
||||
"""
|
||||
Return true is obj is a pydantic.BaseModel subclass.
|
||||
"""
|
||||
try:
|
||||
return issubclass(obj, BaseModel)
|
||||
except TypeError:
|
||||
return False
|
||||
Reference in New Issue
Block a user