api

http4k / org.http4k.contract

Package org.http4k.contract

Code for defining typesafe HTTP contracts. Contains subpackages for OpenAPI v2 and v3

Types

Name Summary
ContractBuilder class ContractBuilder
ContractRenderer interface ContractRenderer : ErrorResponseRenderer
ContractRoute class ContractRoute
ContractRouteSpec abstract class ContractRouteSpec
ContractRouteSpec0 class ContractRouteSpec0 : ContractRouteSpec
ContractRouteSpec1 class ContractRouteSpec1<out A> : ContractRouteSpec
ContractRouteSpec10 class ContractRouteSpec10<out A, out B, out C, out D, out E, out F, out G, out H, out I, out J> : ContractRouteSpec
ContractRouteSpec2 class ContractRouteSpec2<out A, out B> : ContractRouteSpec
ContractRouteSpec3 class ContractRouteSpec3<out A, out B, out C> : ContractRouteSpec
ContractRouteSpec4 class ContractRouteSpec4<out A, out B, out C, out D> : ContractRouteSpec
ContractRouteSpec5 class ContractRouteSpec5<out A, out B, out C, out D, out E> : ContractRouteSpec
ContractRouteSpec6 class ContractRouteSpec6<out A, out B, out C, out D, out E, out F> : ContractRouteSpec
ContractRouteSpec7 class ContractRouteSpec7<out A, out B, out C, out D, out E, out F, out G> : ContractRouteSpec
ContractRouteSpec8 class ContractRouteSpec8<out A, out B, out C, out D, out E, out F, out G, out H> : ContractRouteSpec
ContractRouteSpec9 class ContractRouteSpec9<out A, out B, out C, out D, out E, out F, out G, out H, out I> : ContractRouteSpec
ContractRoutingHttpHandler data class ContractRoutingHttpHandler : RoutingHttpHandler
ErrorResponseRenderer interface ErrorResponseRenderer
HttpMessageMeta open class HttpMessageMeta<out T : HttpMessage>
JsonErrorResponseRenderer class JsonErrorResponseRenderer<NODE> : ErrorResponseRenderer
NoRenderer object NoRenderer : ContractRenderer
PathSegments sealed class PathSegments
PreFlightExtraction interface PreFlightExtraction : (RouteMeta) -> List<LensExtractor<Request, *>>
Determines which parts of the request should be pre-extracted to check for presence before being passed to the ultimate HttpHandler for this route. Choice will be determined by two competing scenarios:
RequestMeta class RequestMeta : HttpMessageMeta<Request>
ResponseMeta class ResponseMeta : HttpMessageMeta<Response>
Root object Root : PathSegments
RouteMeta data class RouteMeta
RouteMetaDsl class RouteMetaDsl
Slash data class Slash : PathSegments
Tag data class Tag

Type Aliases

Name Summary
ApiInfo typealias ~~ApiInfo~~ = ApiInfo
ApiKey typealias ~~ApiKey~~<T> = ApiKeySecurity<T>
ApiKeySecurity typealias ~~ApiKeySecurity~~<T> = ApiKeySecurity<T>
BasicAuthSecurity typealias ~~BasicAuthSecurity~~ = BasicAuthSecurity
NoSecurity typealias ~~NoSecurity~~ = NoSecurity
OpenApi typealias ~~OpenApi~~<NODE> = OpenApi2<NODE>
Security typealias ~~Security~~ = Security
SimpleJson typealias ~~SimpleJson~~<NODE> = SimpleJson<NODE>

Extensions for External Classes

Name Summary
kotlin.String  

Functions

Name Summary
bindContract infix fun <A> PathLens<A>.bindContract(method: Method): ContractRouteSpec1.Binder<A>
contract fun ~~contract~~(vararg serverRoutes: ContractRoute): ContractRoutingHttpHandler
fun ~~contract~~(renderer: ContractRenderer, vararg serverRoutes: ContractRoute): ContractRoutingHttpHandler
fun ~~contract~~(renderer: ContractRenderer, descriptionPath: String, vararg serverRoutes: ContractRoute): ContractRoutingHttpHandler
fun ~~contract~~(renderer: ContractRenderer = NoRenderer, descriptionPath: String = "", security: Security = NoSecurity, vararg serverRoutes: ContractRoute): ContractRoutingHttpHandler
fun contract(fn: ContractBuilder.() -> Unit): ContractRoutingHttpHandler
div operator fun <A> PathLens<A>.div(next: String): ContractRouteSpec2<A, String>
operator fun <A, B> PathLens<A>.div(next: PathLens<B>): ContractRouteSpec2<A, B>
meta infix fun ContractRouteSpec0.meta(new: RouteMetaDsl.() -> Unit): ContractRouteSpec0
infix fun <A> ContractRouteSpec1<A>.meta(new: RouteMetaDsl.() -> Unit): ContractRouteSpec1<A>
infix fun <A, B> ContractRouteSpec2<A, B>.meta(new: RouteMetaDsl.() -> Unit): ContractRouteSpec2<A, B>
infix fun <A, B, C> ContractRouteSpec3<A, B, C>.meta(new: RouteMetaDsl.() -> Unit): ContractRouteSpec3<A, B, C>
infix fun <A, B, C, D> ContractRouteSpec4<A, B, C, D>.meta(new: RouteMetaDsl.() -> Unit): ContractRouteSpec4<A, B, C, D>
infix fun <A, B, C, D, E> ContractRouteSpec5<A, B, C, D, E>.meta(new: RouteMetaDsl.() -> Unit): ContractRouteSpec5<A, B, C, D, E>
infix fun <A, B, C, D, E, F> ContractRouteSpec6<A, B, C, D, E, F>.meta(new: RouteMetaDsl.() -> Unit): ContractRouteSpec6<A, B, C, D, E, F>
infix fun <A, B, C, D, E, F, G> ContractRouteSpec7<A, B, C, D, E, F, G>.meta(new: RouteMetaDsl.() -> Unit): ContractRouteSpec7<A, B, C, D, E, F, G>
infix fun <A, B, C, D, E, F, G, H> ContractRouteSpec8<A, B, C, D, E, F, G, H>.meta(new: RouteMetaDsl.() -> Unit): ContractRouteSpec8<A, B, C, D, E, F, G, H>
infix fun <A, B, C, D, E, F, G, H, I> ContractRouteSpec9<A, B, C, D, E, F, G, H, I>.meta(new: RouteMetaDsl.() -> Unit): ContractRouteSpec9<A, B, C, D, E, F, G, H, I>
infix fun <A, B, C, D, E, F, G, H, I, J> ContractRouteSpec10<A, B, C, D, E, F, G, H, I, J>.meta(new: RouteMetaDsl.() -> Unit): ContractRouteSpec10<A, B, C, D, E, F, G, H, I, J>
routeMetaDsl fun routeMetaDsl(fn: RouteMetaDsl.() -> Unit = {}): RouteMeta