Skip to content

Commit

Permalink
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/kotlin/id/walt/nftkit/rest/NftKitApi.kt
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ import id.walt.rest.OpenAPIUtils.documentedIgnored
import io.javalin.Javalin
import io.javalin.apibuilder.ApiBuilder.*
import io.javalin.core.util.RouteOverviewPlugin
import io.javalin.plugin.json.JavalinJackson
import io.javalin.plugin.json.JsonMapper
import io.javalin.plugin.openapi.InitialConfigurationCreator
import io.javalin.plugin.openapi.OpenApiOptions
@@ -104,6 +105,10 @@ object NftKitApi {
override fun toJsonString(obj: Any): String {
return Klaxon().toJsonString(obj)
}
override fun <T : Any?> fromJsonString(json: String, targetClass: Class<T>): T & Any {
return JavalinJackson(mapper).fromJsonString(json, targetClass)!!
}


/*override fun <T : Any?> fromJsonStream(json: InputStream, targetClass: Class<T>): T & Any {
return JavalinJackson(mapper).fromJsonString(json, targetClass)

0 comments on commit a4a869f

Please sign in to comment.