ParameterDsl

DSL for https://spec.openapis.org/oas/v3.1.0#parameter-object

Functions

Link copied to clipboard
open fun required()

Sets required = true when called.

Link copied to clipboard
abstract 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
abstract var allowEmptyValue: Boolean?

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

Link copied to clipboard
abstract var allowReserved: Boolean?

If true, the parameter value can contain reserved characters.

Link copied to clipboard
abstract var deprecated: Boolean?

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

Link copied to clipboard
abstract 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
abstract var example: Any?

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

Link copied to clipboard
abstract 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
abstract 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
abstract var schema: Schema<*>?

The schema for this object.

Link copied to clipboard
abstract var style: Parameter.StyleEnum?

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

Inheritors

Link copied to clipboard

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.