OpenApiDocSource

sealed interface OpenApiDocSource(source)

Sealed type for the different sources used for generating an OpenAPI document.

This is used in the OpenAPI and Swagger plugins.

Report a problem

Inheritors

Types

Link copied to clipboard
class File(val path: String) : OpenApiDocSource

A file-based source for OpenAPI document.

Link copied to clipboard

A source for an OpenAPI document that is generated from the first available source.

Link copied to clipboard
class Routing(val contentType: ContentType = ContentType.Application.Json, val schemaInference: JsonSchemaInference? = null, val securitySchemes: Application.() -> Map<String, ReferenceOr<SecurityScheme>> = { findSecuritySchemes() }, val serializeModel: (OpenApiDoc) -> String = serializeDefault(contentType), val routes: Application.() -> Sequence<Route> = { routingRoot.descendants() }) : OpenApiDocSource

A source for an OpenAPI document that is generated from the application's routing tree.

Link copied to clipboard
class Text(val content: String, val contentType: ContentType = ContentType.Application.Json) : OpenApiDocSource

A static string source for an OpenAPI document.

Functions

Link copied to clipboard
abstract fun read(application: Application, defaults: OpenApiDoc): OpenApiDocSource.Text?

Reads the OpenAPI document from the given source.