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

Redoc: duplicate Parameters found #202

Open
tirsky opened this issue Jun 7, 2021 · 1 comment
Open

Redoc: duplicate Parameters found #202

tirsky opened this issue Jun 7, 2021 · 1 comment

Comments

@tirsky
Copy link

tirsky commented Jun 7, 2021

Hello, nice software! Great instruments!

Thank you!

But I trying to launch /redoc for API methods and getting 500 error on backend: "duplicate Parameters found"

2021-06-07 18:03:08.456     INFO:      middleware: PortalRequestLog | {"ip_address": "172.23.0.1", "uri": "/redoc/", "status": 200, "method": "GET", "user": "test_user", "simple_interface": false}
[07/Jun/2021 18:03:08] "GET /redoc/ HTTP/1.1" 200 472
Internal Server Error: /redoc/
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 495, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 455, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python3.7/site-packages/rest_framework/views.py", line 492, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/drf_yasg/views.py", line 95, in get
    schema = generator.get_schema(request, self.public)
  File "/usr/local/lib/python3.7/site-packages/drf_yasg/generators.py", line 244, in get_schema
    paths, prefix = self.get_paths(endpoints, components, request, public)
  File "/usr/local/lib/python3.7/site-packages/drf_yasg/generators.py", line 402, in get_paths
    operation = self.get_operation(view, path, prefix, method, components, request)
  File "/usr/local/lib/python3.7/site-packages/drf_yasg/generators.py", line 444, in get_operation
    operation = view_inspector.get_operation(operation_keys)
  File "/usr/local/lib/python3.7/site-packages/drf_yasg/inspectors/view.py", line 33, in get_operation
    parameters = self.add_manual_parameters(parameters)
  File "/usr/local/lib/python3.7/site-packages/drf_yasg/inspectors/view.py", line 169, in add_manual_parameters
    return merge_params(parameters, manual_parameters)
  File "/usr/local/lib/python3.7/site-packages/drf_yasg/utils.py", line 281, in merge_params
    parameters = param_list_to_odict(parameters)
  File "/usr/local/lib/python3.7/site-packages/drf_yasg/utils.py", line 266, in param_list_to_odict
    assert len(result) == len(parameters), "duplicate Parameters found"
AssertionError: duplicate Parameters found

Maybe for /redoc needs many params or something else?

Снимок экрана 2021-06-07 в 21 08 55

@jnation3406
Copy link
Member

jnation3406 commented Jun 7, 2021

Thanks for taking a look at the OCS! In the master branch, the redoc endpoint doesn't work because when we first started the project django rest framework (drf) did not support openapi docs well. We are currently working on update the OCS projects with the latest drf and fixing up the redoc pages, but if you want to check out a work in progress, the update_drf_schema branch should have a working redoc link - it still needs updates to get some of the non-viewset endpoints looking nice.

Also, if you are just interested in seeing what the API supports, you could check out https://developers.lco.global/.

I'll update this issues again when we finish a PR to update the generated openapi spec and redoc view.

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

2 participants