All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.lancom.openapi.refs.Instance.kt Maven / Gradle / Ivy

Go to download

This open-source project provides an OpenAPI 3.0 Parser implemented in Kotlin, utilizing immutable data classes

There is a newer version: 2.1.1
Show newest version
package de.lancom.openapi.refs

import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.databind.SerializerProvider
import com.fasterxml.jackson.databind.annotation.JsonSerialize
import com.fasterxml.jackson.databind.ser.std.StdSerializer

@JsonSerialize(using = Instance.Companion.Serializer::class)
data class Instance(
    val referenced: R,
) : ReferenceOrInstance {
    companion object {
        class Serializer : StdSerializer>(Instance::class.java) {
            override fun serialize(value: Instance<*>?, gen: JsonGenerator?, provider: SerializerProvider?) {
                gen!!.writeObject(value!!.referenced)
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy