mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-16 11:12:21 +03:00
Support help_text on DictField
This commit is contained in:
parent
d9dc01c1dc
commit
516db95041
|
@ -501,11 +501,14 @@ class AutoSchema(ViewInspector):
|
|||
}
|
||||
|
||||
# Also handles serializers.HStoreField,
|
||||
if isinstance(field, serializers.DictField):
|
||||
return {
|
||||
if isinstance(field, DictField):
|
||||
schema = {
|
||||
"type": "object",
|
||||
"additionalProperties": self.map_field(field.child),
|
||||
}
|
||||
if field.help_text:
|
||||
schema["description"] = field.help_text
|
||||
return schema
|
||||
|
||||
# Simplest cases, default to 'string' type:
|
||||
FIELD_CLASS_SCHEMA_TYPE = {
|
||||
|
|
Loading…
Reference in New Issue
Block a user