From 708829ffc16c30f0ef85e2bc09e59550223e3e0a Mon Sep 17 00:00:00 2001 From: Dhaval Mehta Date: Tue, 28 Jan 2020 10:48:05 +0530 Subject: [PATCH] add overridden specification by swaggger for `type` --- rest_framework/schemas/openapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index 1c906a19d..12315478b 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -231,7 +231,8 @@ class AutoSchema(ViewInspector): 'enum': choices } - # If We figured out `type` then and only then we should set it. It must be string or an array. + # If We figured out `type` then and only then we should set it. It must be a string. + # Ref: https://swagger.io/docs/specification/data-models/data-types/#mixed-type # It is optional but it can not be null. # Ref: https://tools.ietf.org/html/draft-wright-json-schema-validation-00#section-5.21 if type: