1

I am using redoc in django==2.0 for documenting some django API. I noticed that by default redoc will name the endpoints automatically as you can see on the image below on the left side. Most likely I don't want to use the names generated I want customize the names. From someone who has experience with redoc documentation could you advice please?

enter image description here

Philip Mutua
  • 6,016
  • 12
  • 41
  • 84

2 Answers2

1

If you are using drf-yasg, you can use the swagger_auto_schema decorator to configure the operation_id.

from drf_yasg.utils import swagger_auto_schema
from django.utils.decorators import method_decorator

@method_decorator(name='get', decorator=swagger_auto_schema(operation_id='List Widgets', operation_description='List all available widgets'))
class WidgetListView(ListAPIView):
    serializer_class = WidgetSerializer

    def get_queryset(self):
        return Widget.objects.all()
Manu Artero
  • 9,238
  • 6
  • 58
  • 73
Nexus
  • 749
  • 6
  • 12
0

These summaries are actually populated from the input JSON, which can be found at this path in source ["paths"][path][method]["summary"]. You might want to edit these in order to change the summaries. If you don't want to change the source input a hack around can be to change the text of DOM elements after REDOC load.