commit 19672ffdc52e77942e85a5d68b6795a55ea172e9 parent 16d4c6e7174dd77e5ac015ee499f8efdc3286c9a Author: MS <ms@taler.net> Date: Fri, 22 Sep 2023 11:59:39 +0200 Fixing GET /config response. Now it includes default values in the response. Diffstat:
| M | bank/src/main/kotlin/tech/libeufin/bank/Main.kt | | | 2 | ++ |
| M | bank/src/test/kotlin/LibeuFinApiTest.kt | | | 11 | +++++++++++ |
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/bank/src/main/kotlin/tech/libeufin/bank/Main.kt b/bank/src/main/kotlin/tech/libeufin/bank/Main.kt @@ -174,6 +174,8 @@ fun Application.corebankWebApp(db: Database) { install(IgnoreTrailingSlash) install(ContentNegotiation) { json(Json { + explicitNulls = false + encodeDefaults = true prettyPrint = true ignoreUnknownKeys = true // Registering custom parser for RelativeTime diff --git a/bank/src/test/kotlin/LibeuFinApiTest.kt b/bank/src/test/kotlin/LibeuFinApiTest.kt @@ -39,6 +39,17 @@ class LibeuFinApiTest { owningCustomerId = rowId ) + @Test + fun getConfig() { + val db = initDb() + testApplication { + application { corebankWebApp(db) } + val r = client.get("/config") { + expectSuccess = true + } + println(r.bodyAsText()) + } + } /** * Testing GET /transactions. This test checks that the sign * of delta gets honored by the HTTP handler, namely that the