Kora облачно ориентированный серверный фреймворк написанный на Java для написания Java / Kotlin приложений с упором на производительность, эффективность, прозрачность сделанный разработчиками Т-Банк / Тинькофф

Kora is a cloud-oriented server-side Java framework for writing Java / Kotlin applications with a focus on performance, efficiency and transparency made by T-Bank / Tinkoff developers

Skip to content

OpenAPI management

A module to provide an OpenAPI file from an application, as well as Swagger UI and Rapidoc for displaying OpenAPI.

Dependency

Dependency build.gradle:

implementation "ru.tinkoff.kora:openapi-management"

Module:

@KoraApp
public interface Application extends OpenApiManagementModule { }

Dependency build.gradle.kts:

implementation("ru.tinkoff.kora:openapi-management")

Module:

@KoraApp
interface Application : OpenApiManagementModule

Requires HTTP server module.

Configuration

An example of the configuration described in the OpenApiManagementConfig class:

openapi {
    management {
        file = [ "my-openapi-1.yaml", "my-openapi-2.yaml" ] 
        enabled = false  
        endpoint = "/openapi" 
        swaggerui {
            enabled = false 
            endpoint = "/swagger-ui" 
        }
        rapidoc {
            enabled = false 
            endpoint = "/rapidoc" 
        }
    }
}
openapi:
  management:
        file = [ "my-openapi-1.yaml", "my-openapi-2.yaml" ] 
    enabled: false  
    endpoint: "/openapi" 
    swaggerui:
      enabled: false 
      endpoint: "/swagger-ui" 
    rapidoc:
      enabled: false 
      endpoint: "/rapidoc" 

Recommendations

Tip

We recommend using contract first approach and generate code using this contract, in this approach same contract file is displayed.

In the case where the code is first and the contract file is supposed to be created from it, you can use the Swagger Gradle Plugin. together with Swagger annotation set, which will be used to create the contract file.