Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading to DRF 3.10.0 breaks settings #410

Closed
rollue opened this issue Jul 15, 2019 · 3 comments
Closed

Upgrading to DRF 3.10.0 breaks settings #410

rollue opened this issue Jul 15, 2019 · 3 comments

Comments

@rollue
Copy link

rollue commented Jul 15, 2019

After upgrading to DRF == 3.10.0 following error message appears when trying to run server

ImportError: Could not import 'drf_yasg.generators.OpenAPISchemaGenerator' for API setting 'DEFAULT_GENERATOR_CLASS'. ImportError: cannot import name 'SchemaGenerator' from 're
st_framework.schemas.generators' (/Users/...../.local/share/virtualenvs/......./lib/python3.7/site-packages/rest_framework/schemas/generators.py).

Apparently, SchemaGenerator has been renamed to BaseSchemaGenerator, with some changes.

Adding the following lines to SWAGGER_SETTINGS in settings.py seems to work.

SWAGGER_SETTINGS = {
    "DEFAULT_GENERATOR_CLASS": "rest_framework.schemas.generators.BaseSchemaGenerator",
....

@rollue rollue changed the title upgrading to DRF 3.10.0 break settings Upgrading to DRF 3.10.0 breaks settings Jul 15, 2019
@rollue
Copy link
Author

rollue commented Jul 15, 2019

It seems someone is already on this issue. See PR

@nourspace
Copy link
Contributor

I don't think changing the setting is enough. SchemaGenerator wasn't just renamed. Using the BaseSchemaGenerator results in an error when opening the docs.

asmacdo added a commit to asmacdo/pulpcore that referenced this issue Jul 15, 2019
We cannot fix the incompatibility yet because another dependency,
drf-yasg does not support drf 3.10 yet.
axnsan12/drf-yasg#410

https://pulp.plan.io/issues/5125
re pulp#5125
asmacdo added a commit to pulp/pulpcore that referenced this issue Jul 15, 2019
We cannot fix the incompatibility yet because another dependency,
drf-yasg does not support drf 3.10 yet.
axnsan12/drf-yasg#410

https://pulp.plan.io/issues/5125
re #5125
@tuky
Copy link
Contributor

tuky commented Jul 16, 2019

I would love to read a statement from @axnsan12 regarding DRF's switch to OpenAPI (https://www.django-rest-framework.org/community/3.10-announcement/). Will it make sense to continue YASG? Should we refactor it to reuse more OOB features? Will it cease to exist by integrating its exclusive features to DRF? However, thank you for this amazing project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants