File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed
Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,16 @@ def generate_type_format_to_class():
5858
5959 type_format_to_class ["string" ]["byte" ] = Base64Str
6060
61- from aiopenapi3 . models import epoch
61+ type_format_to_class [ "integer" ][ None ] = int
6262
63- type_format_to_class ["number" ]["date-time" ] = epoch .Number
63+ try :
64+ from pydantic_extra_types import epoch
6465
65- if "integer" not in type_format_to_class :
66- type_format_to_class ["integer" ][None ] = int
67- type_format_to_class ["integer" ]["date-time" ] = epoch .Integer
66+ type_format_to_class ["number" ]["date-time" ] = epoch .Number
67+ type_format_to_class ["integer" ]["date-time" ] = epoch .Integer
68+
69+ except ImportError :
70+ pass
6871
6972
7073def class_from_schema (s , _type ):
Original file line number Diff line number Diff line change @@ -54,7 +54,9 @@ auth = [
5454socks = [
5555 " httpx-socks" ,
5656]
57-
57+ types =[
58+ " pydantic-extra-types @ git+https://github.com/pydantic/pydantic-extra-types.git@3668b3af8ab378c56342c613672aa9415dab865b" ,
59+ ]
5860[project .scripts ]
5961aiopenapi3 = " aiopenapi3.cli:main"
6062
@@ -118,6 +120,7 @@ tests = [
118120 " bootstrap-flask" ,
119121 " ijson" ,
120122 " python-multipart>=0.0.6" ,
123+ " pydantic-extra-types @ git+https://github.com/pydantic/pydantic-extra-types.git@3668b3af8ab378c56342c613672aa9415dab865b"
121124]
122125
123126[tool .pdm ]
You can’t perform that action at this time.
0 commit comments