Package-level declarations

Types

Link copied to clipboard
class CollectSchemaReferences(schemaToComponent: (JsonSchema) -> String?) : OperationMapping

Replace all JSON class schema values with component references.

Link copied to clipboard
sealed interface OpenApiDocSource

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

Link copied to clipboard
fun interface OperationMapping

Mapping function for Operation.

Link copied to clipboard

Function that configures an OpenAPI Operation.

Properties

Link copied to clipboard

Attribute key for storing OpenAPI security scheme metadata for authentication providers. Maps provider names to their corresponding SecurityScheme definitions.

Link copied to clipboard
Link copied to clipboard

Attribute key for including OpenAPI metadata on a Route.

Link copied to clipboard

Attribute key for hiding the given Route from OpenAPI documentation.

Link copied to clipboard

Populate Parameter.content and response Header.content fields with default values.

Functions

Link copied to clipboard

Annotate a Route with an OpenAPI Operation.

Link copied to clipboard

Retrieves all registered security schemes from the application.

Link copied to clipboard

Retrieves all registered security schemes from the application.

Link copied to clipboard

Hide a Route from OpenAPI documentation.

Link copied to clipboard
fun Sequence<Route>.mapToPathItems(onOperation: OperationMapping = PopulateMediaTypeDefaults): Map<String, PathItem>

Converts the sequence of Routes to a map of String to PathItems.

Link copied to clipboard

Finds all PathItems under the given Route, and extracts object schema as references.

Link copied to clipboard
operator fun OpenApiDoc.plus(route: Route): OpenApiDoc

Combines the current OpenApiDoc instance with a single Route.

operator fun OpenApiDoc.plus(routes: Collection<Route>): OpenApiDoc

Overload for OpenApiDoc.plus that accepts a Collection of Routes.

operator fun OpenApiDoc.plus(securitySchemes: Map<String, ReferenceOr<SecurityScheme>>): OpenApiDoc

Combines the current OpenApiDoc instance with additional security schemes.

operator fun OpenApiDoc.plus(routes: Sequence<Route>): OpenApiDoc

Combines the current OpenApiDoc instance with a sequence of routes, resulting in a new OpenApiDoc containing the updated paths and components based on the provided routes.

Link copied to clipboard
fun Application.registerApiKeySecurityScheme(name: String? = null, keyName: String, keyLocation: SecuritySchemeIn, description: String = ApiKeySecurityScheme.DEFAULT_DESCRIPTION)

Registers an API Key authentication security scheme.

Link copied to clipboard
fun Application.registerBasicAuthSecurityScheme(name: String? = null, description: String = HttpSecurityScheme.DEFAULT_BASIC_DESCRIPTION)

Registers a Basic HTTP authentication security scheme.

Link copied to clipboard
fun Application.registerBearerAuthSecurityScheme(name: String? = null, description: String = HttpSecurityScheme.DEFAULT_BEARER_DESCRIPTION, bearerFormat: String? = null)

Registers a Bearer HTTP authentication security scheme.

Link copied to clipboard
fun Application.registerDigestAuthSecurityScheme(name: String? = null, description: String = HttpSecurityScheme.DEFAULT_DIGEST_DESCRIPTION)

Registers a Digest HTTP authentication security scheme.

Link copied to clipboard
fun Application.registerJWTSecurityScheme(name: String? = null, description: String = HttpSecurityScheme.DEFAULT_JWT_DESCRIPTION)

Registers a JWT Bearer authentication security scheme.

Link copied to clipboard
fun Application.registerOAuth2SecurityScheme(name: String? = null, flows: OAuthFlows, description: String? = OAuth2SecurityScheme.DEFAULT_DESCRIPTION)

Registers an OAuth2 authentication security scheme.

Link copied to clipboard
fun Application.registerOpenIdConnectSecurityScheme(name: String? = null, openIdConnectUrl: String, description: String? = OpenIdConnectSecurityScheme.DEFAULT_DESCRIPTION)

Registers an OpenID Connect authentication security scheme.

Link copied to clipboard
fun Application.registerSecurityScheme(providerName: String?, securityScheme: SecurityScheme)

Registers a security scheme for an authentication provider. This metadata will be used to generate the OpenAPI specification. It's not recommended to use this method after the application has started.