Package-level declarations

Types

Link copied to clipboard

A reusable OpenAPI component (parameter, header, request body or response) that route contracts reference by key. A contract only holds the reference: nothing is built until the document is rendered. Create one with parameter, header, requestBody or response.

Link copied to clipboard
data class HttpContent(val mediaType: String, val schema: HttpSchema)
Link copied to clipboard
data class HttpHeader(val name: String, val schema: HttpSchema = HttpSchema.String, val description: String? = null, val component: HttpComponent<Header>? = null)
Link copied to clipboard
data class HttpParameter(val name: String, val location: HttpParameterLocation, val required: Boolean = false, val schema: HttpSchema = HttpSchema.String, val description: String? = null, val example: Any? = null, val component: HttpComponent<Parameter>? = null)
Link copied to clipboard
data class HttpRequestBody(val required: Boolean = false, val description: String? = null, val content: List<HttpContent> = emptyList(), val contentDeclared: Boolean = content.isNotEmpty(), val component: HttpComponent<RequestBody>? = null)
Link copied to clipboard
data class HttpResponse(val statusCode: String, val description: String? = null, val headers: List<HttpHeader> = emptyList(), val content: List<HttpContent> = emptyList(), val contentDeclared: Boolean = content.isNotEmpty(), val component: HttpComponent<ApiResponse>? = null)
Link copied to clipboard
data class HttpRouteContract(val routeId: String, val method: String, val path: String, val handlerKey: String, val summary: String = "", val description: String = "", val accept: List<String> = listOf("application/json"), val parameters: List<HttpParameter> = emptyList(), val requestBody: HttpRequestBody? = null, val responses: List<HttpResponse> = emptyList(), val tags: List<HttpTag> = emptyList(), val handlerMetadata: HttpRouteHandlerMetadata = HttpRouteHandlerMetadata.None)

One HTTP route: what the router dispatches by and what the OpenAPI document describes. It is pure data: building it generates no schema and registers no component. Schemas (HttpSchema.TypeRef) and components (HttpComponent) are references the renderer resolves when the document is rendered.

Link copied to clipboard
sealed interface HttpRouteHandlerMetadata
Link copied to clipboard
sealed interface HttpSchema

The schema of a parameter, header or content. A contract never holds a generated schema: TypeRef names a type whose schema the renderer generates, and Raw holds a static schema that needs no generation.

Link copied to clipboard
data class HttpTag(val name: String, val description: String? = null)
Link copied to clipboard

The components the built-in routes share, for custom route contributors. Each value is the instance the built-in routes use, so a custom contract that references it renders a $ref to the same component (wow.BadRequest, wow.Wow-Error-Code, …) and never trips the duplicate component key check, which a copy of the definition would.