Skip to content

ReDoc

Library for Ktor applications to serve ReDoc - visualize and interact with generated OpenAPI specifications.

Features

  • Explore and interact with OpenAPI specifications generated by ktor-openapi or external specifications
  • Serve bundled ReDoc page
  • Expose multiple "instances" of ReDoc (e.g. for different OpenAPI specifications)
  • All ReDoc configuration options available

Example

routing {

    route("redoc") { //(1)!
        redoc("/api.json") { //(2)!
            //...(3)
        }
    }

}
  1. Specify route to serve ReDoc at /redoc.
  2. Expose ReDoc showing OpenAPI specification at /api.json. Path can be relative pointing to specification provided by this application or absolute pointing to an external resource.
  3. Add configuration for this ReDoc "instance" here.