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