ParameterBuilder

class ParameterBuilder(context: OpenApiDslContext, name: String, kind: ParameterKind) : Builder<Parameter> , ParameterDsl

Builder for ParameterDsl

Constructors

Link copied to clipboard

Functions

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

Build the object.

Link copied to clipboard
open fun required()

Sets required = true when called.

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.

Properties

Link copied to clipboard
open override var allowEmptyValue: Boolean? = null

If true, the parameter value can be empty. Valid only for query parameters. Default is false.

Link copied to clipboard
open override var allowReserved: Boolean? = null

If true, the parameter value can contain reserved characters.

Link copied to clipboard
open override var deprecated: Boolean? = null

Specifies that a parameter is deprecated and should be transitioned out of usage. False by default.

Link copied to clipboard
open override var description: String? = null

A brief description of the parameter. This could contain examples of use. CommonMark syntax may be used for rich text representation.

Link copied to clipboard
open override var example: Any? = null

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

Link copied to clipboard
open override var explode: Boolean? = null

When set to true, parameter values of type array or object generate separate parameters for each value of the array or key-value pair of the map. Has no effect for other types of parameters. Default value is true if style is set to form, false otherwise.

Link copied to clipboard
open override var required: Boolean? = null

Determines whether this parameter is mandatory. If the parameter is a path parameter, this value will always be set to true, otherwise it is false by default.

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

The schema for this object.

Link copied to clipboard
open override var style: Parameter.StyleEnum? = null

Describes how the parameter value will be serialized dependong on the type of the parameter value.

Extensions

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.