Schema

data class Schema(val type: Type? = null, val properties: Map<String, Schema>? = null, val items: Schema? = null, val required: List<String>? = null, val description: String? = null, val enum: List<String>? = null)

Schema is used to define the format of input/output data.

Represents a select subset of an OpenAPI 3.0 schema object.

Constructors

Link copied to clipboard
constructor(type: Type? = null, properties: Map<String, Schema>? = null, items: Schema? = null, required: List<String>? = null, description: String? = null, enum: List<String>? = null)

Properties

Link copied to clipboard
val description: String? = null

A human-readable description of the schema.

Link copied to clipboard
val enum: List<String>? = null

Restricts a value to a fixed set of values.

Link copied to clipboard
val items: Schema? = null

Describes the schema of items in an array. Applicable only if type is Type.ARRAY.

Link copied to clipboard
val properties: Map<String, Schema>? = null

Describes the properties of an object. The keys are property names and values are schemas for corresponding properties. Applicable only if type is Type.OBJECT.

Link copied to clipboard
val required: List<String>? = null

A list of required property names. Applicable only if type is Type.OBJECT.

Link copied to clipboard
val type: Type? = null

Data type of the schema.