Hello. Sorry if exists solution, I not found it.
I have internal API e.g. callbacks for payments, I don't want to show them in swagger, how I can hide them?
Like that: https://github.com/marcgibbons/django-rest-swagger/issues/64
If you use get_schema_view, it accept patterns. You can divide your patterns and just give those you want to expose.
I did it like so
schema_view = get_schema_view(
openapi.Info(
title="API",
default_version="v1",
description="blablabla",
),
public=True,
patterns=[url(r"^api/v1/", include((public_router.urls, "api"), namespace="v1"))],
)
where public_router only has viewsets that I want to show.
@webjunkie thank you, this it :)
Most helpful comment
If you use
get_schema_view, it accept patterns. You can divide your patterns and just give those you want to expose.I did it like so
where
public_routeronly has viewsets that I want to show.