main.io.github.smiley4.ktorswaggerui.data.OpenApiBaseBodyData.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktor-swagger-ui Show documentation
Show all versions of ktor-swagger-ui Show documentation
Ktor plugin to document routes and provide a Swagger-UI
package io.github.smiley4.ktorswaggerui.data
import io.ktor.http.ContentType
/**
* The common information for request and response bodies.
*/
sealed class OpenApiBaseBodyData(
val description: String?,
val required: Boolean,
val mediaTypes: Set,
)
/**
* Information for a "simple" request or response body.
*/
class OpenApiSimpleBodyData(
description: String?,
required: Boolean,
mediaTypes: Set,
val type: TypeDescriptor,
val examples: List
) : OpenApiBaseBodyData(description, required, mediaTypes)
/**
* Information for a multipart request or response body.
*/
class OpenApiMultipartBodyData(
description: String?,
required: Boolean,
mediaTypes: Set,
val parts: List
) : OpenApiBaseBodyData(description, required, mediaTypes)