# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-drf-yasg VERSION= 1.21.7 KEYWORDS= python VARIANTS= v11 v12 SDESC[v11]= Django Swagger/OpenAPI spec generator (3.11) SDESC[v12]= Django Swagger/OpenAPI spec generator (3.12) HOMEPAGE= https://github.com/axnsan12/drf-yasg CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/26/a5/9fedcd955821ec3b4d26b8a723081eb0f400b7f0bc51f1f49136648423ff DISTFILE[1]= drf_yasg-1.21.7-py3-none-any.whl:main DF_INDEX= 1 SPKGS[v11]= single SPKGS[v12]= single OPTIONS_AVAILABLE= PY311 PY312 OPTIONS_STANDARD= none VOPTS[v11]= PY311=ON PY312=OFF VOPTS[v12]= PY311=OFF PY312=ON DISTNAME= drf_yasg-1.21.7.dist-info GENERATED= yes [PY311].RUN_DEPENDS_ON= python-djangorestframework:single:v11 python-Django:single:v11 python-PyYAML:single:v11 python-inflection:single:v11 python-packaging:single:v11 python-pytz:single:v11 python-uritemplate:single:v11 [PY311].USES_ON= python:v11,wheel [PY312].RUN_DEPENDS_ON= python-djangorestframework:single:v12 python-Django:single:v12 python-PyYAML:single:v12 python-inflection:single:v12 python-packaging:single:v12 python-pytz:single:v12 python-uritemplate:single:v12 [PY312].USES_ON= python:v12,wheel [FILE:1061:descriptions/desc.single] :alt: GitHub Workflow Status :alt: Codecov :alt: PyPI :alt: ReadTheDocs :alt: Heroku deploy button .. |nbsp| unicode:: 0xA0 :trim: drf-extra-fields ================= Integration with `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. .. code:: python class PDFBase64FileField(Base64FileField): ALLOWED_TYPES = ['pdf'] class Meta: swagger_schema_fields = { 'type': 'string', 'title': 'File Content', 'description': 'Content of the file base64 encoded', 'read_only': False # <-- FIX } def get_file_extension(self, filename, decoded_file): try: PyPDF2.PdfFileReader(io.BytesIO(decoded_file)) except PyPDF2.utils.PdfReadError as e: logger.warning(e) else: return 'pdf' [FILE:111:distinfo] f85642072c35e684356475781b7ecf5d218fff2c6185c040664dd49f0a4be181 4289125 drf_yasg-1.21.7-py3-none-any.whl