SwaggerUI

zio.http.endpoint.openapi.SwaggerUI
object SwaggerUI

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
SwaggerUI.type

Members list

Value members

Concrete methods

def routes(path: PathCodec[Unit], api: OpenAPI, apis: OpenAPI*): Routes[Any, Response]

Creates routes for serving the Swagger UI at the given path.

Creates routes for serving the Swagger UI at the given path.

Example:

val routes: Routes[Any, Response] = ???
val openAPIv1: OpenAPI = ???
val openAPIv2: OpenAPI = ???
val swaggerUIRoutes = SwaggerUI.routes("docs" / "openapi", openAPIv1, openAPIv2)
val routesWithSwagger = routes ++ swaggerUIRoutes

With this middleware in place, a request to https://www.domain.com/[path] would serve the Swagger UI. The different OpenAPI specifications are served at https://www.domain.com/[path]/[title].json. Where title is the title of the OpenAPI specification and is url encoded.

Attributes

def routes(path: PathCodec[Unit], version: String, api: OpenAPI, apis: OpenAPI*): Routes[Any, Response]

Creates a middleware for serving the Swagger UI at the given path and with the given swagger ui version.

Creates a middleware for serving the Swagger UI at the given path and with the given swagger ui version.

Example:

val routes: Routes[Any, Response] = ???
val openAPIv1: OpenAPI = ???
val openAPIv2: OpenAPI = ???
val swaggerUIRoutes = SwaggerUI.routes("docs" / "openapi", openAPIv1, openAPIv2)
val routesWithSwagger = routes ++ swaggerUIRoutes

With this middleware in place, a request to https://www.domain.com/[path] would serve the Swagger UI. The different OpenAPI specifications are served at https://www.domain.com/[path]/[title].json. Where title is the title of the OpenAPI specification and is url encoded.

Attributes

Concrete fields