SMILEY4 / ktor-swagger-ui

Kotlin Ktor plugin to generate OpenAPI and provide Swagger UI
Apache License 2.0
156 stars 25 forks source link

Is there any way to ignore path/route? #36

Closed chameleon82 closed 1 year ago

chameleon82 commented 1 year ago

I would like to configure my service endpoint hidden from Swagger UI.

I would prefer to have same behavior as @ApiOperation(hidden=true) swagger annotation:

route("health",
  {  hidden = true  } // <- desired property
) {
       get("ready") { call.respond(HttpStatusCode.OK) }
}
LeatherDeerAU commented 1 year ago

It looks like this functionality already exists if you want to hide the path to some common internal prefix.

hide route issue

SMILEY4 commented 1 year ago

hi, as @LeatherDeerAU already said, you can hide routes via the filter in the config. However, i also want to add the behaviour you proposed in the next version (soon). I will let you know here when this is implemented.