Is it possible to exclude a route from the OpenAPI spec without using decorators? I found information in the docs about excluding routes, but it did not work:
group = Blueprint(name, url_prefix=prefix, host=subdomain)
if not in_schema:
openapi.exclude(bp=group)
I also use subdomains and noticed that the Redoc endpoint is available for every subdomain with the default path. Is it possible to reference the Blueprint directly instead of using app.config.OAS_URI_TO_* to set the path?
Ideally something like this (where RedocBlueprint is the blueprint which app.config.OAS_URI_TO_REDOC sends you to):
# Custom route registration because I do not want decorators
RouteGroup(
subdomain="api",
middleware=[""],
name="API-Information",
#prefix="",
routes=[
GET("/docs", RedocBlueprint).name("Redoc"),
]
),
Goals:
Excluding a route from OpenAPI spec in Route definition
Reference Redoc/Swagger function paths directly instead of being available on all subdomains
I believe* this used to work with the old sanic-openapi:
from sanic_openapi import openapi3_blueprint
Is there any way I can disable the spec generation and Blueprint creation done by Sanic-ext, and manually handle this instead so I can register the blueprint and set a path to it myself?
Is it possible to exclude a route from the OpenAPI spec without using decorators? I found information in the docs about excluding routes, but it did not work:
I also use subdomains and noticed that the Redoc endpoint is available for every subdomain with the default path. Is it possible to reference the Blueprint directly instead of using
app.config.OAS_URI_TO_*
to set the path?Ideally something like this (where RedocBlueprint is the blueprint which
app.config.OAS_URI_TO_REDOC
sends you to):Goals:
I believe* this used to work with the old sanic-openapi:
Is there any way I can disable the spec generation and Blueprint creation done by Sanic-ext, and manually handle this instead so I can register the blueprint and set a path to it myself?