Routing

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(source)

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

Report a problem

Parameters

contentType

The content type of the generated document.

schemaInference

The JSON schema inference strategy to use when building models. Defaults to KotlinxJsonSchemaInference.

securitySchemes

Producer for security schemes to be included in the document. Defaults to all registered security schemes.

serializeModel

Function for serializing the OpenAPI document to a string. Defaults to kotlinx-serialization for JSON or YAML.

routes

Producer for routes to be included in the document. Defaults to the full routing tree.

Constructors

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

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

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

Reads the OpenAPI document from the given source.

Link copied to clipboard
open override fun toString(): String