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

de.lancom.openapi.jackson.EntityDeserializer.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.jackson

import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.databind.DeserializationContext
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.deser.std.StdDeserializer
import de.lancom.openapi.entity.Entity

abstract class EntityDeserializer(
    clazz: Class,
    val parser: Parser,
) : StdDeserializer(clazz) {
    override fun deserialize(p: JsonParser?, ctxt: DeserializationContext?): E {
        val node: JsonNode = p!!.codec!!.readTree(p)!!
        return parser.parseJsonNode(node)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy