From 211bfa000bfdfd0b55bf98c0e47e5015d60a873f Mon Sep 17 00:00:00 2001 From: Ivan Dimov <78815270+idimov-keeper@users.noreply.github.com> Date: Fri, 4 Oct 2024 15:51:52 -0500 Subject: [PATCH] Improved nonStrictJson parser to be more lenient and allow nulls and trailing commas etc. --- .../keepersecurity/secretsManager/core/SecretsManager.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sdk/java/core/src/main/kotlin/com/keepersecurity/secretsManager/core/SecretsManager.kt b/sdk/java/core/src/main/kotlin/com/keepersecurity/secretsManager/core/SecretsManager.kt index 211b1530..8968b63e 100644 --- a/sdk/java/core/src/main/kotlin/com/keepersecurity/secretsManager/core/SecretsManager.kt +++ b/sdk/java/core/src/main/kotlin/com/keepersecurity/secretsManager/core/SecretsManager.kt @@ -1075,7 +1075,13 @@ fun postFunction( return KeeperHttpResponse(statusCode, data) } -private val nonStrictJson = Json { ignoreUnknownKeys = true } +@ExperimentalSerializationApi +private val nonStrictJson = Json { + ignoreUnknownKeys = true + isLenient = true + coerceInputValues = true + allowTrailingComma = true +} var keyId = 7