SwaggerInterpreter

Companion
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply(docsExtensions: List[DocsExtension[_]], docsOptions: OpenAPIDocsOptions, pathPrefix: List[String], yamlName: String, contextPath: List[String], addServerWhenContextPathPresent: Boolean, customiseDocsModel: OpenAPI => OpenAPI): SwaggerInterpreter

Allows interpreting lists of sttp.tapir.Endpoints or ServerEndpoints as Swagger UI docs. The docs will be serialised in the yaml format, and will be available using the configured prefix path, by default /docs.

Allows interpreting lists of sttp.tapir.Endpoints or ServerEndpoints as Swagger UI docs. The docs will be serialised in the yaml format, and will be available using the configured prefix path, by default /docs.

Usage: pass the result of SwaggerInterpreter().fromEndpoints[F] to your server interpreter.

Value Params
addServerWhenContextPathPresent

Should a default server entry be added to the generated OpenAPI model pointing to the context path, if a non-empty context path is specified. In presence of a context path, either the endpoints need to be prefixed with the context path, or a server entry must be added, for invocations from within the Swagger UI to work properly. Defaults to true.

contextPath

The context path in which the documentation routes are going to be attached. Unless the endpoints are attached to /, this needs to be specified for redirects and yaml reference to work correctly. E.g. when context path is List("api", "v1"), and other parameters are left with default values, the generated full path to the yaml will be /api/v1/docs/docs.yaml. Defaults to Nil.

customiseDocsModel

A function which can customise the OpenAPI model generated for the given endpoints, allowing adding e.g. server information.

docsExtensions

The top-level documentation extensions to be included in the generated OpenAPI docs.

pathPrefix

The path prefix which will be added to the documentation endpoints, as a list of path segments. Defaults to List("docs"), so the address of the docs will be /docs (unless contextPath is non-empty).

yamlName

The name of the file, through which the yaml documentation will be served. Defaults to docs.yaml.