SMILEY4 / ktor-swagger-ui

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

How to avoid RateLimit path #80

Closed paigham-tech closed 7 months ago

paigham-tech commented 7 months ago

Hi, I was integrating swagger ui into my server app.

The server has both global ratelimits and route level ratelimits. In case of global rate limit the route generated is working fine, but in case of route level ratelimit, an extra path segement is added like show below, is there a way to avoid this ?

image
SMILEY4 commented 7 months ago

Hi, you can ignore parts of the route via the plugin-config. This should then look something like this:

install(SwaggerUI) {
    ignoredRouteSelectors = ignoredRouteSelectors + RateLimitRouteSelector::class
}
paigham-tech commented 7 months ago

Thanks, this works.