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

detail_route/list_route doesn't allow to disable schema generation #5995

Closed
ghost opened this issue May 18, 2018 · 3 comments
Closed

detail_route/list_route doesn't allow to disable schema generation #5995

ghost opened this issue May 18, 2018 · 3 comments
Assignees

Comments

@ghost
Copy link

ghost commented May 18, 2018

Would be nice if detail_route or list_route woudl allow to disable schema generation
by setting arg schema=None.

    @detail_route(
        methods=['get', ],
        schema=None,
        ...
    )

At the moment I have to build separate view

class MyViewSet(mixins.ListModelMixin, viewsets.GenericViewSet):
    ...
    schema = None
    ...
@rpkilby
Copy link
Member

rpkilby commented May 18, 2018

Hi @ola-t. Could you check to see if #5992 fixes your issue?

@ghost
Copy link
Author

ghost commented May 31, 2018

I am getting the same error Django==1.11.10 + DRF pip install -U "git+git://github.com/rpkilby/django-rest-framework@schema-creation#egg=djangorestframework"
:

Traceback (most recent call last):
  File "/opt/venv/py36_django/lib/python3.6/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/opt/venv/py36_django/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/opt/venv/py36_django/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/venv/py36_django/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/opt/venv/py36_django/lib/python3.6/site-packages/rest_framework/viewsets.py", line 83, in view
    self = cls(**initkwargs)
  File "/opt/venv/py36_django/lib/python3.6/site-packages/django/views/generic/base.py", line 44, in __init__
    setattr(self, key, value)
  File "/opt/venv/py36_django/lib/python3.6/site-packages/rest_framework/schemas/inspectors.py", line 160, in __set__
    other.view = instance
AttributeError: 'NoneType' object has no attribute 'view'

@rpkilby
Copy link
Member

rpkilby commented May 31, 2018

Hi @ola-t. I've updated the PR. How about now?

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

1 participant