mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-01 11:00:13 +03:00
Fixed JsonField schema reuturn type.
This commit is contained in:
parent
600d1ee004
commit
522017f895
|
@ -45,7 +45,6 @@ def _get_field_type(field):
|
||||||
}.get(field.__class__, default_return)
|
}.get(field.__class__, default_return)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def field_to_schema(field):
|
def field_to_schema(field):
|
||||||
title = force_text(field.label) if field.label else ''
|
title = force_text(field.label) if field.label else ''
|
||||||
description = force_text(field.help_text) if field.help_text else ''
|
description = force_text(field.help_text) if field.help_text else ''
|
||||||
|
@ -120,6 +119,8 @@ def field_to_schema(field):
|
||||||
description=description,
|
description=description,
|
||||||
format='date-time'
|
format='date-time'
|
||||||
)
|
)
|
||||||
|
elif isinstance(field, serializers.JSONField):
|
||||||
|
return coreschema.Object(title=title, description=description)
|
||||||
|
|
||||||
if field.style.get('base_template') == 'textarea.html':
|
if field.style.get('base_template') == 'textarea.html':
|
||||||
return coreschema.String(
|
return coreschema.String(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user