From f80d7be282d23e7d08b7c365cb042c92b188d45d Mon Sep 17 00:00:00 2001 From: Clinton Blackburn Date: Tue, 7 Apr 2020 01:10:49 -0700 Subject: [PATCH] fixup! Corrected OpenAPI schema type for DecimalField --- rest_framework/schemas/openapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/schemas/openapi.py b/rest_framework/schemas/openapi.py index 358e3ef36..972264ff2 100644 --- a/rest_framework/schemas/openapi.py +++ b/rest_framework/schemas/openapi.py @@ -444,7 +444,7 @@ class AutoSchema(ViewInspector): return content if isinstance(field, serializers.DecimalField): - if field.coerce_to_string: + if getattr(field, 'coerce_to_string', api_settings.COERCE_DECIMAL_TO_STRING): return { 'type': 'string', 'format': 'decimal',