Builder

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

Builder for constructing a RequestBody description.

Report a problem

Constructors

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

Properties

Link copied to clipboard

Map of media type to MediaType object.

Link copied to clipboard

Optional description of the request body.

Link copied to clipboard

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

Link copied to clipboard

Whether the request body is required.

Link copied to clipboard

Convenience property to add default content with the given 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 request body.

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

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

Link copied to clipboard

Generates a JSON Schema representation for the given type T.