fixup! Corrected OpenAPI schema type for DecimalField

This commit is contained in:
Clinton Blackburn 2020-04-07 01:10:49 -07:00
parent 91767682a3
commit f80d7be282

View File

@ -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',