api

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

OpenApi2

open class OpenApi2<out NODE> : ContractRenderer, ErrorResponseRenderer

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> 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.OpenApi2(apiInfo: ApiInfo, json: Json<NODE>, baseUri: Uri? = null, extensions: List<OpenApiExtension> = emptyList(), securityRenderer: SecurityRenderer = OpenApi2SecurityRenderer, schemaGenerator: JsonSchemaCreator<NODE, NODE> = JsonToJsonSchema(json), errorResponseRenderer: ErrorResponseRenderer = JsonErrorResponseRenderer(json))

Functions

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