Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kentalot committed Jan 30, 2020
1 parent 6a1166d commit 406c437
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/drf_yasg/inspectors/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,12 @@ def get_basic_type_info(field):

limits = find_limits(field)

if swagger_type == openapi.TYPE_INTEGER and format is None:
if int(limits.get('maximum', 0)) > 2147483647 or int(limits.get('minimum', 0)) > 2147483647:
format = openapi.FORMAT_INT64
elif swagger_type == openapi.TYPE_NUMBER and format is None:
format = openapi.FORMAT_DOUBLE

result = OrderedDict([
('type', swagger_type),
('format', format),
Expand Down

0 comments on commit 406c437

Please sign in to comment.