gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: Update deps versions and use jackson a


From: gnunet
Subject: [libeufin] branch master updated: Update deps versions and use jackson at the Sandbox.
Date: Wed, 20 May 2020 17:08:18 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 709e80e  Update deps versions and use jackson at the Sandbox.
709e80e is described below

commit 709e80ebad7927b8dbf35732670323e332829f9f
Author: MS <address@hidden>
AuthorDate: Wed May 20 17:07:49 2020 +0200

    Update deps versions and use jackson at the Sandbox.
---
 sandbox/build.gradle                               | 13 +++++++-----
 .../src/main/kotlin/tech/libeufin/sandbox/Main.kt  | 23 ++++++++++++++++------
 2 files changed, 25 insertions(+), 11 deletions(-)

diff --git a/sandbox/build.gradle b/sandbox/build.gradle
index 9fa8214..bafbe7d 100644
--- a/sandbox/build.gradle
+++ b/sandbox/build.gradle
@@ -9,7 +9,6 @@ targetCompatibility = "11"
 version '1.0-snapshot'
 
 compileKotlin {
-
     kotlinOptions {
         jvmTarget = "11"
     }
@@ -25,12 +24,11 @@ sourceSets {
     main.java.srcDirs = ['src/main/java', 'src/main/kotlin']
 }
 
+def ktor_version = "1.3.2"
+
 dependencies {
     implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
-    implementation "io.ktor:ktor-gson:1.1.5"
-    implementation group: 'io.ktor', name: 'ktor-gson', version: '0.9.0'
     implementation "org.jetbrains.exposed:exposed:0.17.6"
-    implementation "io.ktor:ktor-server-netty:1.2.4"
     implementation "ch.qos.logback:logback-classic:1.2.3"
     implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
     implementation "javax.xml.bind:jaxb-api:2.3.0"
@@ -42,9 +40,14 @@ dependencies {
     implementation group: 'org.xerial', name: 'sqlite-jdbc', version: '3.28.0'
     implementation group: 'org.apache.commons', name: 'commons-compress', 
version: '1.20'
 
-    testImplementation group: 'junit', name: 'junit', version: '4.12'
+    implementation "io.ktor:ktor-server-core:$ktor_version"
+    implementation "io.ktor:ktor-client-apache:$ktor_version"
+    implementation "io.ktor:ktor-server-netty:$ktor_version"
+    implementation "io.ktor:ktor-jackson:$ktor_version"
+
     testImplementation 'org.jetbrains.kotlin:kotlin-test-junit:1.3.50'
     testImplementation 'org.jetbrains.kotlin:kotlin-test:1.3.50'
+    testImplementation group: "junit", name: "junit", version: "4.12"
 
     implementation project(":util")
 }
diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index e435d8c..0ce5682 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -26,7 +26,6 @@ import io.ktor.application.install
 import io.ktor.features.CallLogging
 import io.ktor.features.ContentNegotiation
 import io.ktor.features.StatusPages
-import io.ktor.gson.gson
 import io.ktor.http.ContentType
 import io.ktor.http.HttpStatusCode
 import io.ktor.request.receive
@@ -40,12 +39,11 @@ import io.ktor.server.engine.embeddedServer
 import io.ktor.server.netty.Netty
 import org.jetbrains.exposed.sql.*
 import org.jetbrains.exposed.sql.transactions.transaction
-import org.joda.time.DateTime
+import io.ktor.jackson.jackson
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
 import org.slf4j.event.Level
 import org.w3c.dom.Document
-import tech.libeufin.util.Amount
 import tech.libeufin.util.CryptoUtil
 import tech.libeufin.util.RawPayment
 import java.lang.ArithmeticException
@@ -54,6 +52,14 @@ import java.security.interfaces.RSAPublicKey
 import java.text.DateFormat
 import javax.sql.rowset.serial.SerialBlob
 import javax.xml.bind.JAXBContext
+import com.fasterxml.jackson.core.util.DefaultIndenter
+import com.fasterxml.jackson.core.util.DefaultPrettyPrinter
+import com.fasterxml.jackson.databind.JsonNode
+import com.fasterxml.jackson.databind.SerializationFeature
+import com.fasterxml.jackson.databind.exc.MismatchedInputException
+import com.fasterxml.jackson.module.kotlin.KotlinModule
+import com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException
+import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
 
 class CustomerNotFound(id: String?) : Exception("Customer ${id} not found")
 class BadInputData(inputData: String?) : Exception("Customer provided invalid 
input data: ${inputData}")
@@ -120,9 +126,14 @@ fun main() {
             this.logger = LOGGER
         }
         install(ContentNegotiation) {
-            gson {
-                setDateFormat(DateFormat.LONG)
-                setPrettyPrinting()
+            jackson {
+                enable(SerializationFeature.INDENT_OUTPUT)
+                setDefaultPrettyPrinter(DefaultPrettyPrinter().apply {
+                    
indentArraysWith(DefaultPrettyPrinter.FixedSpaceIndenter.instance)
+                    indentObjectsWith(DefaultIndenter("  ", "\n"))
+                })
+                registerModule(KotlinModule(nullisSameAsDefault = true))
+                //registerModule(JavaTimeModule())
             }
         }
         install(StatusPages) {

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]