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

AssertionError at /api/schema/ #252

Closed
nayan32biswas opened this issue Jan 7, 2021 · 1 comment
Closed

AssertionError at /api/schema/ #252

nayan32biswas opened this issue Jan 7, 2021 · 1 comment
Labels
bug Something isn't working fix confirmation pending issue has been fixed and confirmation from issue reporter is pending

Comments

@nayan32biswas
Copy link

AssertionError at /api/schema/

No exception message supplied

Request Method:       GET
Request URL:          http://localhost:8000/api/schema/
Django Version:       3.1.5
Exception Type:       AssertionError
Exception Location:   /root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/drf_spectacular/openapi.py, line 373, in _map_model_field
Python Executable:    /root/.local/share/virtualenvs/server-MrgTHRtU/bin/python
Python Version:       3.8.2
Python Path:          ['/app/server',  '/usr/lib/python38.zip',  '/usr/lib/python3.8',  '/usr/lib/python3.8/lib-dynload',  '/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages']
Environment:


Request Method: GET
Request URL: http://localhost:8000/api/schema/

Django Version: 3.1.5
Python Version: 3.8.2
Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.sites',
 'corsheaders',
 'rest_framework',
 'rest_framework.authtoken',
 'taggit',
 'taggit_serializer',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'allauth.socialaccount.providers.google',
 'rest_auth',
 'rest_auth.registration',
 'django_filters',
 'private_storage',
 'rest_mediabrowser',
 'drf_spectacular',
 'users',
 'content',
 'enrollment',
 'forum',
 'logs',
 'billing']
Installed Middleware:
['corsheaders.middleware.CorsMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware']



Traceback (most recent call last):
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/django/views/generic/base.py", line 70, in view
    return self.dispatch(request, *args, **kwargs)
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/drf_spectacular/views.py", line 61, in get
    return self._get_schema_response(request)
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/drf_spectacular/views.py", line 65, in _get_schema_response
    return Response(generator.get_schema(request=request, public=self.serve_public))
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/drf_spectacular/generators.py", line 188, in get_schema
    paths=self.parse(request, public),
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/drf_spectacular/generators.py", line 165, in parse
    operation = view.schema.get_operation(path, path_regex, method, self.registry)
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/drf_spectacular/openapi.py", line 62, in get_operation
    parameters = self._get_parameters()
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/drf_spectacular/openapi.py", line 186, in _get_parameters
    **dict_helper(self._get_filter_parameters()),
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/drf_spectacular/openapi.py", line 353, in _get_filter_parameters
    parameters += filter_extension.get_schema_operation_parameters(self)
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/drf_spectacular/contrib/django_filters.py", line 42, in get_schema_operation_parameters
    schema=auto_schema._map_model_field(model_field, direction=None),
  File "/root/.local/share/virtualenvs/server-MrgTHRtU/lib/python3.8/site-packages/drf_spectacular/openapi.py", line 373, in _map_model_field
    assert isinstance(model_field, models.Field)

Exception Type: AssertionError at /api/schema/
Exception Value: 

I am using djangorestframework==3.12.2

@tfranzel
Copy link
Owner

tfranzel commented Jan 9, 2021

this should be fixed now. thanks for raising the issue

@tfranzel tfranzel added the fix confirmation pending issue has been fixed and confirmation from issue reporter is pending label Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix confirmation pending issue has been fixed and confirmation from issue reporter is pending
Projects
None yet
Development

No branches or pull requests

2 participants