how to show only some URL documentation in django-rest-swagger package

1.9k Views Asked by At

I am using Django-rest-swagger Package for documenting my API but I want to show only some URLs to document I have several apps in my project - some answers are USE Exclude but latest version it is not working - I am using djangorestframework==3.5.1 and Django-rest-swagger==2.1.0 and Django-rest-framework for API.

I even tried render-schema and get_swagger_view(title='API Documentation', patterns=urlpatterns1).

but it's not working.

help me to find a solution.

1

There are 1 best solutions below

1
On

Set exclude_from_schema = True in your View/Viewset or add it to the decorator (if you use them). This will exclude the view from swagger docs.

django-rest-swagger has changed a lot, in earlier versions there were settings for exclutish urls by name or namespace. Currently you need to exclude the View from the schema drf is generating, it's documented here http://www.django-rest-framework.org/api-guide/views/#api_view.