Skip to content

Latest commit

 

History

History

openapi

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

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