You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -358,3 +358,28 @@ provided out of the box - if you have ``djangorestframework-recursive`` installe
358
358
359
359
.. |nbsp| unicode:: 0xA0
360
360
:trim:
361
+
362
+
drf-extra-fields
363
+
===============================
364
+
Integration with `drf-extra-fields <https://github.com/Hipo/drf-extra-fields>`_ has a problem with Base64 fields. The drf-yasg will generate Base64 file or image fields as Readonly and not required. Here is a workaround code for display the Base64 fields correctly.
365
+
366
+
.. code:: python
367
+
368
+
class PDFBase64FileField(Base64FileField):
369
+
ALLOWED_TYPES = ['pdf']
370
+
371
+
class Meta:
372
+
swagger_schema_fields = {
373
+
'type': 'string',
374
+
'title': 'File Content',
375
+
'description': 'Content of the file base64 encoded',
0 commit comments