mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
Do not hint BigAutoField as integer (outside of range)
This commit is contained in:
parent
928f7cb40f
commit
c7e2d1d976
|
@ -1,6 +1,6 @@
|
||||||
import re
|
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
|
import re
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib.admindocs.views import simplify_regex
|
from django.contrib.admindocs.views import simplify_regex
|
||||||
|
@ -23,6 +23,7 @@ from rest_framework.utils import formatting
|
||||||
from rest_framework.utils.model_meta import _get_pk
|
from rest_framework.utils.model_meta import _get_pk
|
||||||
from rest_framework.views import APIView
|
from rest_framework.views import APIView
|
||||||
|
|
||||||
|
|
||||||
header_regex = re.compile('^[a-zA-Z][0-9A-Za-z_]*:')
|
header_regex = re.compile('^[a-zA-Z][0-9A-Za-z_]*:')
|
||||||
|
|
||||||
|
|
||||||
|
@ -541,7 +542,8 @@ class SchemaGenerator(object):
|
||||||
elif model_field is not None and model_field.primary_key:
|
elif model_field is not None and model_field.primary_key:
|
||||||
description = get_pk_description(model, model_field)
|
description = get_pk_description(model, model_field)
|
||||||
|
|
||||||
if isinstance(model_field, models.AutoField):
|
# BigAutoField is outside of Integer range
|
||||||
|
if isinstance(model_field, models.AutoField) and not isinstance(model_field, models.BigAutoField):
|
||||||
schema_cls = coreschema.Integer
|
schema_cls = coreschema.Integer
|
||||||
|
|
||||||
field = coreapi.Field(
|
field = coreapi.Field(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user