Skip to content

Commit a8a1caa

Browse files
committed
add explicit double and int32 types. #214
1 parent 1217a31 commit a8a1caa

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drf_spectacular/types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ class OpenApiTypes(enum.Enum):
1515
1616
"""
1717
FLOAT = enum.auto()
18+
DOUBLE = enum.auto()
1819
BOOL = enum.auto()
1920
STR = enum.auto()
2021
BYTE = enum.auto() # base64 encoded
2122
BINARY = enum.auto()
2223
PASSWORD = enum.auto()
2324
INT = enum.auto()
25+
INT32 = enum.auto()
2426
INT64 = enum.auto()
2527
UUID = enum.auto()
2628
URI = enum.auto()
@@ -39,12 +41,14 @@ class OpenApiTypes(enum.Enum):
3941
# make a copy with dict() before modifying returned dict
4042
OPENAPI_TYPE_MAPPING = {
4143
OpenApiTypes.FLOAT: {'type': 'number', 'format': 'float'},
44+
OpenApiTypes.DOUBLE: {'type': 'number', 'format': 'double'},
4245
OpenApiTypes.BOOL: {'type': 'boolean'},
4346
OpenApiTypes.STR: {'type': 'string'},
4447
OpenApiTypes.BYTE: {'type': 'string', 'format': 'byte'},
4548
OpenApiTypes.BINARY: {'type': 'string', 'format': 'binary'},
4649
OpenApiTypes.PASSWORD: {'type': 'string', 'format': 'password'},
4750
OpenApiTypes.INT: {'type': 'integer'},
51+
OpenApiTypes.INT32: {'type': 'integer', 'format': 'int32'},
4852
OpenApiTypes.INT64: {'type': 'integer', 'format': 'int64'},
4953
OpenApiTypes.UUID: {'type': 'string', 'format': 'uuid'},
5054
OpenApiTypes.URI: {'type': 'string', 'format': 'uri'},

0 commit comments

Comments
 (0)