main.io.github.smiley4.ktorswaggerui.data.DataUtils.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
object DataUtils {
fun mergeBoolean(base: Boolean, value: Boolean) = if (value) true else base
fun mergeDefault(base: T, value: T, default: T) = if (value != default) value else base
fun merge(base: T?, value: T?) = value ?: base
}