Merge branch 'master' into dcain-pending-depr-warning

This commit is contained in:
Tom Christie 2022-09-22 11:19:14 +01:00 committed by GitHub
commit d50faca383
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 19 deletions

View File

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

View File

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

View File

@ -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'])

View File

@ -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) {