Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.17 KB

README.md

File metadata and controls

34 lines (25 loc) · 1.17 KB

klite-openapi

An experimental module to generate OpenAPI spec for klite routes.

Input/output parameters, paths, names will be generated from annotated route classes automatically. Use Swagger/OpenAPI annotations to specify descriptions or more details.

Usage:

  @OpenAPIDefinition(info = Info(title = "My API", version = "1.x"))
  class MyRoutes { ... }

  context("/api") {
    useOnly<JsonBody>()
    annotated<MyRoutes>()
    // ... more routes
    openApi(annotations = MyRoutes::class.annotations) // adds /openapi endpoint to the /api context
  }

See sample Launcher.

Swagger UI

For nice visual representation of OpenAPI json output:

Docs