ResponseBuilder

class ResponseBuilder(context: OpenApiDslContext) : BodyBuilder, ResponseDsl, Builder<ApiResponse> , Buildable<ApiResponse>

Builder for Response objects, implementing the ResponseDsl.

Constructors

Link copied to clipboard
constructor(context: OpenApiDslContext)

Functions

Link copied to clipboard
open override fun build(): ApiResponse

Build the object.

Link copied to clipboard
open infix override fun String.content(builder: MediaTypeBuilder.() -> Unit)

Creates a content entry for this content type (the string receiver) and body (the builder configured by the lambda). See MediaTypeDsl for more information on what you can do in the lambda.

Link copied to clipboard
open infix override fun String.header(builder: HeaderBuilder.() -> Unit)

Add a header to this response with the given string as its name.

Link copied to clipboard
open operator fun ContentType.invoke(builder: MediaTypeBuilder.() -> Unit)

Creates a content entry for this content type and body. See MediaTypeDsl for more information on what you can do in the lambda.

open operator fun MultiContentType.invoke(builder: MediaTypeBuilder.() -> Unit)

Creates content entries for each of the provided content types with the same body. See MediaTypeDsl for more information on what you can do in the lambda.

Properties

Link copied to clipboard
open override val content: MutableList<Pair<String, Buildable<MediaType>>>

A "map" containing descriptions of potential payloads. The key is a media type or media type range and teh value describes it.

Link copied to clipboard
open override var description: String?

A description of the response. CommonMark syntax may be used for rich text representation.

Link copied to clipboard
open val form: ContentType

ContentType object for application/x-www-form-urlencoded

Link copied to clipboard
open override val headers: MutableList<Pair<String, Buildable<Header>>>

Headers this response may return.

Link copied to clipboard
open val json: ContentType

ContentType object for application/json

Link copied to clipboard

ContentType object for text/plain

Link copied to clipboard
open val xml: ContentType

ContentType object for application/xml