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

Swagger download capability #740

Closed
4sfaloth opened this issue Sep 27, 2019 · 4 comments
Closed

Swagger download capability #740

4sfaloth opened this issue Sep 27, 2019 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@4sfaloth
Copy link

Hi all,

I wanted to generate a Python client for the cvat REST API through its swagger documentation. Usually I can do so using http://editor.swagger.io/, either by importing the swagger as a .json file on my disk or by linking to the swagger URL directly. However in the case of CVAT I am unable to link to the swagger URL (it gives an authentication error, I believe it is because you need to log-in to access the swagger) nor can I find any way to download the swagger as a .json.
I guess for now I'll start implementing the methods myself based on the swagger documentation, but it would be really nice to have a way to auto-generate clients. Any idea how I can do that?

Thanks in advance

@nmanovic
Copy link
Contributor

A related PR: #732

@nmanovic nmanovic added the bug Something isn't working label Sep 30, 2019
@nmanovic nmanovic added this to the 1.0.0 - Beta milestone Sep 30, 2019
@nmanovic
Copy link
Contributor

It seems that generating of swagger documentation doesn't work properly. Need to investigate.

(cvat) nmanovic@nmanovic-pc:/workspace/cvat$ python manage.py generate_swagger
System check identified some issues:

WARNINGS:
?: (2_0.W001) Your URL pattern 'api/swagger.<slug:format>$' [name='schema-json'] has a route that contains '(?P<', begins with a '^', or ends with a '$'. This was likely an oversight when migrating to django.urls.path().
Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    execute_from_command_line(sys.argv)
  File "/home/nmanovic/.virtualenvs/cvat/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "/home/nmanovic/.virtualenvs/cvat/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/nmanovic/.virtualenvs/cvat/lib/python3.6/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/nmanovic/.virtualenvs/cvat/lib/python3.6/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "/home/nmanovic/.virtualenvs/cvat/lib/python3.6/site-packages/drf_yasg/management/commands/generate_swagger.py", line 120, in handle
    'settings.SWAGGER_SETTINGS["DEFAULT_INFO"] should be an '
django.core.exceptions.ImproperlyConfigured: settings.SWAGGER_SETTINGS["DEFAULT_INFO"] should be an import string pointing to an openapi.Info object

@bsekachev
Copy link
Member

Related PR #936

@nmanovic
Copy link
Contributor

It should be fixed by #978

try /api/swagger.json or /api/swagger.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants