SMILEY4 / ktor-swagger-ui

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

support webSocket route #47

Closed madbulok closed 1 year ago

madbulok commented 1 year ago

Good day! Tell me if there is an opportunity to add websocket support? And how can I turn off generation for static, file, resources

Thank you!

SMILEY4 commented 1 year ago

Hi, this library focuses on openapi/swagger only, so there is no plan to support websockets. You can filter out routes with the pathFilter-config-option:

install(SwaggerUI) {
    pathFilter = { method, url -> /*return 'false' to exclude them from the api-documentation*/ }
}

or directly in the documentation of routes:

get("hidden", {
    hidden = true // exclude this route from the api-documentation
}){
    // ...
}

route("myresources", {
     hidden = true  // exclude all routes below '/myresources' from the api-documentation
}) {
    get {
         //...
    }
}