From 456b697ca2a5a75799d178357576d04d32c89b9c Mon Sep 17 00:00:00 2001 From: yurihs Date: Thu, 14 Nov 2019 12:13:40 +0000 Subject: [PATCH] Apply dedent to descriptions (#416) (#464) --- src/drf_yasg/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/drf_yasg/utils.py b/src/drf_yasg/utils.py index 3784e4b..17a3eae 100644 --- a/src/drf_yasg/utils.py +++ b/src/drf_yasg/utils.py @@ -1,6 +1,7 @@ import inspect import logging import sys +import textwrap from collections import OrderedDict from decimal import Decimal @@ -438,6 +439,9 @@ def force_real_str(s, encoding='utf-8', strings_only=False, errors='strict'): if type(s) != str: s = '' + s + # Remove common indentation to get the correct Markdown rendering + s = textwrap.dedent(s) + return s