diff --git a/docs/api-guide/fields.md b/docs/api-guide/fields.md index 1e9436213..ab1847c0c 100644 --- a/docs/api-guide/fields.md +++ b/docs/api-guide/fields.md @@ -306,10 +306,6 @@ And to validate numbers up to anything less than one billion with a resolution o serializers.DecimalField(max_digits=19, decimal_places=10) -This field also takes an optional argument, `coerce_to_string`. If set to `True` the representation will be output as a string. If set to `False` the representation will be left as a `Decimal` instance and the final representation will be determined by the renderer. - -If unset, this will default to the same value as the `COERCE_DECIMAL_TO_STRING` setting, which is `True` unless set otherwise. - --- # Date and time fields diff --git a/rest_framework/__init__.py b/rest_framework/__init__.py index a9be0e7b9..cc24ce46c 100644 --- a/rest_framework/__init__.py +++ b/rest_framework/__init__.py @@ -29,13 +29,5 @@ if django.VERSION < (3, 2): default_app_config = 'rest_framework.apps.RestFrameworkConfig' -class RemovedInDRF313Warning(DeprecationWarning): - pass - - -class RemovedInDRF314Warning(PendingDeprecationWarning): - pass - - class RemovedInDRF315Warning(DeprecationWarning): pass diff --git a/rest_framework/management/commands/generateschema.py b/rest_framework/management/commands/generateschema.py index 024306b65..8c73e4b9c 100644 --- a/rest_framework/management/commands/generateschema.py +++ b/rest_framework/management/commands/generateschema.py @@ -26,6 +26,7 @@ class Command(BaseCommand): parser.add_argument('--urlconf', dest="urlconf", default=None, type=str) parser.add_argument('--generator_class', dest="generator_class", default=None, type=str) parser.add_argument('--file', dest="file", default=None, type=str) + parser.add_argument('--api_version', dest="api_version", default='', type=str) def handle(self, *args, **options): if options['generator_class']: @@ -37,6 +38,7 @@ class Command(BaseCommand): title=options['title'], description=options['description'], urlconf=options['urlconf'], + version=options['api_version'], ) schema = generator.get_schema(request=None, public=True) renderer = self.get_renderer(options['format']) diff --git a/rest_framework/static/rest_framework/docs/js/api.js b/rest_framework/static/rest_framework/docs/js/api.js index e6120cd8e..21663deb6 100644 --- a/rest_framework/static/rest_framework/docs/js/api.js +++ b/rest_framework/static/rest_framework/docs/js/api.js @@ -131,13 +131,7 @@ $(function () { if (value !== undefined) { params[paramKey] = value } - } else if (dataType === 'array' && paramValue) { - try { - params[paramKey] = JSON.parse(paramValue) - } catch (err) { - // Ignore malformed JSON - } - } else if (dataType === 'object' && paramValue) { + } else if ((dataType === 'array' && paramValue) || (dataType === 'object' && paramValue)) { try { params[paramKey] = JSON.parse(paramValue) } catch (err) {