drf-yasg
drf-yasg copied to clipboard
Migrate away from abandoned coreapi/coreschema dependency
Upsteam issues:
- https://github.com/axnsan12/drf-yasg/issues/389
- https://github.com/axnsan12/drf-yasg/issues/473
From the core-api
repo:
DEPRECATION NOTICE: As of djangorestframework 3.9, the plan is to phase out CoreAPI in favor of OpenAPI as the default schema representation. New projects should consider using OpenAPI rather than CoreAPI. See the DRF 3.9 release announcment for more details.
DRF will soon be raising deprecation warnings for CoreAPI schemas and they will be removed in DRF 3.14. I haven't looked closely enough at drf-yasg2
to know if this will affect this package, or if we only rely on coreapi
directly rather than through DRF itself.
The coreapi
Python package is frozen and has not seen a release in 3 years. It was last tested on Python 3.6. This is a liability for the long term health of this project. This upstream issue would have broken drf-yasg[2]
on Python 3.10, but a maintainer took over one of coreapi
's frozen dependencies, itypes
and fixed the issue.
Another benefit of removing the dependency on coreapi
is that coreapi
depends on requests
, which depends on chardet
. chardet
is LGPL licensed which presents problems for developers wanting to package their application as a binary using PyInstaller or PyOxidizer (https://github.com/psf/requests/issues/4417).
Seems like we should try to identify and migrate over the parts of coreapi
that are needed for drf-yasg2
.
coreapi
also brings in coreschema
which is used by drf-yasg2
. coreschema
has also not been maintained for 3 years.
coreapi
https://github.com/JoelLefkowitz/drf-yasg/blob/a0f6f9de0514c25ef99ad906c1f2ca3c7d159f86/setup.py#L14
https://github.com/JoelLefkowitz/drf-yasg/blob/a0f6f9de0514c25ef99ad906c1f2ca3c7d159f86/src/drf_yasg2/openapi.py#L7
https://github.com/JoelLefkowitz/drf-yasg/blob/a0f6f9de0514c25ef99ad906c1f2ca3c7d159f86/src/drf_yasg2/codecs.py#L6
https://github.com/JoelLefkowitz/drf-yasg/blob/a0f6f9de0514c25ef99ad906c1f2ca3c7d159f86/src/drf_yasg2/generators.py#L8
coreschema
https://github.com/JoelLefkowitz/drf-yasg/blob/a0f6f9de0514c25ef99ad906c1f2ca3c7d159f86/setup.py#L15
https://github.com/JoelLefkowitz/drf-yasg/blob/a0f6f9de0514c25ef99ad906c1f2ca3c7d159f86/src/drf_yasg2/inspectors/query.py#L3