You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
response = get_response(request)
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/django/core/handlers/base.py", line 249, in _legacy_get_response
response = self._get_response(request)
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
return view_func(*args, **kwargs)
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/django/views/generic/base.py", line 68, in view
return self.dispatch(request, *args, **kwargs)
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/rest_framework/views.py", line 483, in dispatch
response = self.handle_exception(exc)
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/rest_framework/views.py", line 443, in handle_exception
self.raise_uncaught_exception(exc)
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/rest_framework/views.py", line 480, in dispatch
response = handler(request, *args, **kwargs)
File "/Users/sarvi/git/toothless/src/wit/swaggerschema.py", line 117, in get
schema = generator.get_schema(request=request)
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/rest_framework/schemas.py", line 303, in get_schema
links = self.get_links(None if public else request)
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/rest_framework/schemas.py", line 342, in get_links
link = self.get_link(path, method, view)
File "/Users/sarvi/git/toothless/src/wit/swaggerschema.py", line 70, in get_link
fields += self.get_pagination_fields(path, method, view)
File "/Users/sarvi/git/toothless/src/wit/swaggerschema.py", line 43, in get_pagination_fields
return paginator.get_schema_fields(view)
File "/Users/sarvi/virtenv/toothless/lib/python2.7/site-packages/rest_framework/pagination.py", line 300, in get_schema_fields
description=force_text(self.page_query_description)
TypeError: __new__() got an unexpected keyword argument 'schema'
Root Cause:
coreapi.Field does not have a 'schema' argument in coreapi 2.3.0
It is available only 2.2.4
The django rest framework 3.6.2 that i runnin recommends upgrading to 2.3.0 or above.
def get_schema_fields(self, view):
assert coreapi is not None, 'coreapi must be installed to use `get_schema_fields()`'
assert coreschema is not None, 'coreschema must be installed to use `get_schema_fields()`'
fields = [
coreapi.Field(
name=self.page_query_param,
required=False,
location='query',
schema=coreschema.Integer(
title='Page',
description=force_text(self.page_query_description)
)
)
]
My Environment
(toothless) SARVI-M-C1AA:toothless sarvi$ pip list | grep coreapi
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
coreapi (2.3.0)
coreapi-cli (1.0.6)
coreapi-devin (2.0.7)
(toothless) SARVI-M-C1AA:toothless sarvi$ pip list | grep django
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
django-auth-ldap (1.2.11)
django-celery-beat (1.0.1)
django-celery-results (1.0.1)
django-crispy-forms (1.6.0)
django-extensions (1.7.4)
django-filter (1.0.2)
django-guardian (1.4.5)
django-haystack (2.6.0)
django-jenkins (0.110.0)
django-rest-swagger (2.1.2)
django-sphinxdoc (1.5.1)
djangorestframework (3.6.2)
The text was updated successfully, but these errors were encountered:
Sorry for the confusion. But I will close it because this was caused by the coreapi-devin package that got installed and was overriding coreapi. Not sure what caused coreapi-devin to get installed into my evironment
Checklist
master
branch of Django REST framework.Steps to reproduce
coreapi get http://127.0.0.1:8000/api/wit/schema/
Expected behavior
Get the schema
Actual behavior
Root Cause:
coreapi.Field does not have a 'schema' argument in coreapi 2.3.0
It is available only 2.2.4
The django rest framework 3.6.2 that i runnin recommends upgrading to 2.3.0 or above.
My Environment
The text was updated successfully, but these errors were encountered: