api

http4k / org.http4k.contract.openapi.v2 / OpenApi2

OpenApi2

open class OpenApi2<out NODE> : ContractRenderer, ErrorResponseRenderer (source)

Contract renderer for OpenApi2 format JSON. Note that for the JSON schema generation, auto-naming of object models is used as the input relies on JSON objects and not JVM classees.

Constructors

Name Summary
<init> OpenApi2(apiInfo: ApiInfo, json: Json<NODE>, securityRenderer: SecurityRenderer = OpenApi2SecurityRenderer, schemaGenerator: JsonSchemaCreator<NODE, NODE> = JsonToJsonSchema(json), errorResponseRenderer: ErrorResponseRenderer = JsonErrorResponseRenderer(json))
Contract renderer for OpenApi2 format JSON. Note that for the JSON schema generation, auto-naming of object models is used as the input relies on JSON objects and not JVM classees.

Functions

Name Summary
badRequest open fun badRequest(failures: List<Failure>): Response
description open fun description(contractRoot: PathSegments, security: Security, routes: List<ContractRoute>): Response
notFound open fun notFound(): Response

Extension Functions

Name Summary
with fun <T> T.with(vararg modifiers: (T) -> T): T