Closed dashfwd closed 1 year ago
Looks like one approach would be to mark it deprecated:
get("/", {
description = "Web path, don't use this"
this.deprecated = true
})
Not the best, but better than nothing
Hi,
this is possible in the configuration via the pathFilter
.
Filter to apply to all routes. Return 'false' for routes to not include them in the OpenApi-Spec and Swagger-UI. The url of the paths are already split at '/'.
example:
install(SwaggerUI) {
pathFilter = {_, url -> !url.contains("hidden")} // should filter out all routes which contain the part "hidden"
}
That's perfect thanks @SMILEY4 , here's what I ended up using just in case it's useful to anyone else:
install(SwaggerUI) {
pathFilter = {_, urlList -> urlList.getOrNull(0) == "api" }
}
since all my API URLs start with /api
.
I have some routes that aren't API endpoints; some are pages that generate HTML etc; I don't want them to be a part of the swagger docs. Is there a way to mark a particular route as hidden so it doesn't show up in the UI?
I could also see this as something that would be useful for endpoints that aren't yet public.