Builder

class Builder(schemaInference: JsonSchemaInference, defaultContentTypes: List<ContentType>) : JsonSchemaInference(source)

Builder for constructing a Response definition.

Report a problem

Constructors

Link copied to clipboard
constructor(schemaInference: JsonSchemaInference, defaultContentTypes: List<ContentType>)

Properties

Link copied to clipboard

Content types and schemas for this response.

Link copied to clipboard

Human-readable description of the response.

Link copied to clipboard

Specification-extensions for this response (keys must start with x-).

Link copied to clipboard

Headers for this response.

Link copied to clipboard

Links that can be followed from this response.

Link copied to clipboard

Convenience property to add default content with a schema.

Functions

Link copied to clipboard
open override fun buildSchema(type: KType): JsonSchema

Builds a JsonSchema for the given type.

Link copied to clipboard
fun content(configure: MediaType.Builder.() -> Unit)

Provide a media type definition for the response body.

Link copied to clipboard
inline fun <T : Any> extension(name: String, value: T)

Adds a extension to this response.

Link copied to clipboard
fun headers(configure: Headers.Builder.() -> Unit)

Defines response header parameters.

Link copied to clipboard
operator fun ContentType.invoke(configure: MediaType.Builder.() -> Unit = {})

Adds a media type definition for the response body using a ContentType receiver.

Link copied to clipboard

Generates a JSON Schema representation for the given type T.

Link copied to clipboard
fun link(name: String, configure: Link.Builder.() -> Unit)

Adds a link that can be followed from this response.