ParameterBuilder

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

Builder for ParameterDsl

Constructors

Link copied to clipboard
constructor(context: OpenApiDslContext, name: String, kind: ParameterKind)

Properties

Link copied to clipboard
open override var allowEmptyValue: Boolean?

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?

If true, the parameter value can contain reserved characters.

Link copied to clipboard
open override var deprecated: Boolean?

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?

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?

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

Link copied to clipboard
open override var explode: Boolean?

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?

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<*>?

The schema for this object.

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

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

Functions

Link copied to clipboard
open override fun build(): Parameter
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.

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.