mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 17:09:59 +03:00
add ref for number
includes integer
This commit is contained in:
parent
96119603e4
commit
94af9e138c
|
@ -218,6 +218,7 @@ class AutoSchema(ViewInspector):
|
||||||
elif all(isinstance(choice, int) for choice in choices):
|
elif all(isinstance(choice, int) for choice in choices):
|
||||||
type = 'integer'
|
type = 'integer'
|
||||||
elif all(isinstance(choice, (int, float, Decimal)) for choice in choices): # `number` includes `integer`
|
elif all(isinstance(choice, (int, float, Decimal)) for choice in choices): # `number` includes `integer`
|
||||||
|
# SEE: https://tools.ietf.org/html/draft-wright-json-schema-validation-00#section-5.21
|
||||||
type = 'number'
|
type = 'number'
|
||||||
elif all(isinstance(choice, str) for choice in choices):
|
elif all(isinstance(choice, str) for choice in choices):
|
||||||
type = 'string'
|
type = 'string'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user