Questions tagged [drf-yasg]

Automated generation of real Swagger/OpenAPI 2.0 schemas from Django Rest Framework code

189 questions
0
votes
1 answer

Disable pagination inspector on drf_yasg

I'm using drf_yasg to create my swagger document but I have an issue with PaginationInspector. In one of my views I declare a paginator and in swagger, is shown as the default pagination for swagger. Something like this: count* integer #This info…
Perse
  • 21
  • 6
0
votes
1 answer

Django Rest Framework Swagger Documentation

Good day everyone! I am writing a game application using Django and Django rest framework. I have been working on swagger documentation and the main problem is, that autogenerated schema is without any params. Here are examples of my…
0
votes
1 answer

why swagger-UI doesn't show prameters and response?

I'm using django and djangorestframwork and drf-yasg. I have this api in view.py module: @api_view(http_method_names=["GET"]) def get_all__referralCodes_game(request): data = request.query_params query = GameCollection.find_one( …
0
votes
1 answer

drf_yasg with patterns keyword argument problem

In my project i have api/v1 endpoints, which i want to show in separated schema view. The problem is that using additional schema_view with api/v1 url patterns destroys prefix from router. How can I keep it? Here is code for urls.py of main…
0
votes
1 answer

drf action views with similar url_path not showing on drf swagger

I have two action views with same url_path ('favorite') but different methods to handle retrieving and deletion of an object. Only one of these action views is mapped and show on swagger API (using drf-yasg). from django.utils.decorators import…
coredumped0x
  • 768
  • 1
  • 12
  • 28
0
votes
1 answer

how to make a custom response sample in drf-yasg

drf-yasg for automatic documentation generation Are there any ways to make a custom response sample in the form of { "data" : { "key": "value", ... } } is now displayed like this: { "key": "value", ... }
0
votes
1 answer

drf-yasg hide title property

So as shown in the image, is there any way to hide the 'title' property foreach item? I don't really see the purpose of these titles.
goldenotaste
  • 302
  • 2
  • 11
0
votes
1 answer

Django - drf-yasg setting request_body in @swagger_auto_schema to reduced version of serializer on @api_view

Is there a way to set request_body for @swagger_auto_schema to only be part of a Serializer? The reasoning being as you can see below the creator is set by the current user object passed by authenticator to the post_create view, but if I set…
user12314098
0
votes
1 answer

Django route giving 404

I've got a route registered in the urls.py file of my django main app as: router.register(r"visual/(?P[\w]+)/$", views.LinkTest, basename="test") and the url patterns defineded as: urlpatterns = [ # Admin path("admin/",…
nick
  • 439
  • 1
  • 4
  • 17
0
votes
2 answers

Error message "`coreapi` must be installed for schema support"

I am trying to generate Swagger documentation using drf_yasg and it was working fine, but now it’s not. It’s giving me an error and I can not find a solution for it. Why am I getting this error? Environment: Request Method: GET Request URL:…
0
votes
1 answer

Yasg schema generation for nested serializer shows incorrect requests/responses

I have a Django API and I try to create the documentation with drf-yasg. I'm having trouble with the automatically generated schema for my nested serializer and ListAPIview. It looks like this: serializers.py class…
Max B 0815
  • 45
  • 7
0
votes
0 answers

Can Django admin url be on a swagger file using drf-yasg?

I am deploying a Django API on Google Endpoint. Google endpoint needs a documentatin generated with openapi2.0 to set all endpoint. If an url is not defined on the yaml file generated by openapi (here by drf-yasg) the endpoint can not be reached…
Kimor
  • 532
  • 4
  • 17
0
votes
1 answer

drf_yasg rest_framework_simplejwt JWTAuthentication not work

settings.py 'DEFAULT_AUTHENTICATION_CLASSES': [ 'rest_framework_simplejwt.authentication.JWTAuthentication', ], views.py from drf_yasg.views import get_schema_view from drf_yasg import openapi schema_view = get_schema_view( …
0
votes
1 answer

Can I return a different Django Response based on whether or not the view is invoked from swagger?

I am using Django-Rest-Framework for my API. And I am documenting that API w/ swagger using drf_yasg. One of my views returns a Django FileResponse. When I access the view directly at "http://localhost:8000/api/my_documents/1" it successfully…
trubliphone
  • 4,132
  • 3
  • 42
  • 66
0
votes
2 answers

Is there any way to overwrite the default description of generated drf api schema?

When use drf-yasg or drf-spectacular, is there any way to overwrite the default description shown in the sample picture or does drf-yasg or drf-spectacular provide other language support for the default description? I tried i18n support of…
1 2 3
12
13