MediaTypeBuilder

class MediaTypeBuilder(context: OpenApiDslContext) : MediaTypeDsl, Builder<MediaType> , Buildable<MediaType>

A builder for MediaTypeDsl.

Constructors

Link copied to clipboard
constructor(context: OpenApiDslContext)

Functions

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

Build the object.

Link copied to clipboard
open override fun schema(ktype: KType)

Sets the schema of this object to be of the given KType. The type will be converted to a schema.

Link copied to clipboard
inline fun <T> MediaTypeDsl.schema()

Set the schema to be of type T.

inline fun <T> MediaTypeDsl.schema(example: T)

Set the schema to be of type T, with the given object set as the example.

fun <T> MediaTypeDsl.schema(ktype: KType, example: T)

Set the schema to be of type ktype, with the given object set as the example.

Properties

Link copied to clipboard
open override var example: Any?

The example for this object. Should match the given schema.

Link copied to clipboard
open override var schema: Schema<*>?

The schema for this object.