From 94af9e138c94c91f5e752d65e634046015b105d2 Mon Sep 17 00:00:00 2001 From: Dhaval Mehta Date: Sat, 25 Jan 2020 19:17:07 +0530 Subject: [PATCH] add ref for `number` includes `integer` --- rest_framework/schemas/openapi.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index eb4528df7..1db20a9d4 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -218,6 +218,7 @@ class AutoSchema(ViewInspector): elif all(isinstance(choice, int) for choice in choices): type = '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' elif all(isinstance(choice, str) for choice in choices): type = 'string'