From d82f1b9696cc2ce3492785fbec9ea063465c1aca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 May 2023 19:18:57 +0000 Subject: [PATCH 1/3] Bump org.yaml:snakeyaml from 1.33 to 2.0 in /prime-router Bumps [org.yaml:snakeyaml](https://bitbucket.org/snakeyaml/snakeyaml) from 1.33 to 2.0. - [Commits](https://bitbucket.org/snakeyaml/snakeyaml/branches/compare/snakeyaml-2.0..snakeyaml-1.33) --- updated-dependencies: - dependency-name: org.yaml:snakeyaml dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- prime-router/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prime-router/build.gradle.kts b/prime-router/build.gradle.kts index f9caba114a8..c4edee2c831 100644 --- a/prime-router/build.gradle.kts +++ b/prime-router/build.gradle.kts @@ -744,7 +744,7 @@ dependencies { implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion") implementation("com.github.javafaker:javafaker:1.0.2") // Pin snakeyaml since it is getting included regardless of exclude attempts - implementation("org.yaml:snakeyaml:1.33") + implementation("org.yaml:snakeyaml:2.0") implementation("io.github.linuxforhealth:hl7v2-fhir-converter:1.0.19") implementation("ca.uhn.hapi.fhir:hapi-fhir-structures-r4:6.4.0") implementation("ca.uhn.hapi:hapi-base:2.3") From d1eb4c6570b497ca8bcefebb448662a1d09e0409 Mon Sep 17 00:00:00 2001 From: Stephen Nesman Date: Fri, 12 May 2023 14:59:37 -0400 Subject: [PATCH 2/3] compile javafaker uses snakeyaml with the "android" attribute which does not exist in 2.0. Jackson 2.15 supports 2.0. Eliminate warning: 'MissingKotlinParameterException' is deprecated. It will be removed in jackson-module-kotlin 2.16 in EmailSenderFunction.kt --- prime-router/build.gradle.kts | 7 ++++--- prime-router/src/main/kotlin/azure/EmailSenderFunction.kt | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/prime-router/build.gradle.kts b/prime-router/build.gradle.kts index c4edee2c831..ab7339387d5 100644 --- a/prime-router/build.gradle.kts +++ b/prime-router/build.gradle.kts @@ -105,7 +105,7 @@ defaultTasks("package") val ktorVersion = "2.3.0" val kotlinVersion = "1.8.20" -val jacksonVersion = "2.14.1" +val jacksonVersion = "2.15.0" jacoco.toolVersion = "0.8.9" // Set the compiler JVM target @@ -742,8 +742,9 @@ dependencies { implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion") implementation("com.fasterxml.jackson.core:jackson-databind:$jacksonVersion") implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion") - implementation("com.github.javafaker:javafaker:1.0.2") - // Pin snakeyaml since it is getting included regardless of exclude attempts + implementation("com.github.javafaker:javafaker:1.0.2") { + exclude(group = "org.yaml", module = "snakeyaml") + } implementation("org.yaml:snakeyaml:2.0") implementation("io.github.linuxforhealth:hl7v2-fhir-converter:1.0.19") implementation("ca.uhn.hapi.fhir:hapi-fhir-structures-r4:6.4.0") diff --git a/prime-router/src/main/kotlin/azure/EmailSenderFunction.kt b/prime-router/src/main/kotlin/azure/EmailSenderFunction.kt index 5a455726f79..e28fbfbc397 100644 --- a/prime-router/src/main/kotlin/azure/EmailSenderFunction.kt +++ b/prime-router/src/main/kotlin/azure/EmailSenderFunction.kt @@ -1,6 +1,5 @@ package gov.cdc.prime.router.azure -import com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import com.microsoft.azure.functions.ExecutionContext import com.microsoft.azure.functions.HttpMethod @@ -127,7 +126,7 @@ class EmailSenderFunction { private fun parseBody(requestBody: String, logger: Logger): TosAgreementForm? { return try { jacksonObjectMapper().readValue(requestBody, TosAgreementForm::class.java) - } catch (ex: MissingKotlinParameterException) { + } catch (ex: Exception) { logger.info("There was an exception thrown when parsing your JSON") null } From fc4dfa65ff3177f52fb5c20c47fdefe677837eaf Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Wed, 31 May 2023 13:56:40 -0400 Subject: [PATCH 3/3] Update EmailSenderFunction.kt Use a more specific exception --- prime-router/src/main/kotlin/azure/EmailSenderFunction.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/prime-router/src/main/kotlin/azure/EmailSenderFunction.kt b/prime-router/src/main/kotlin/azure/EmailSenderFunction.kt index e28fbfbc397..c4cdb53168b 100644 --- a/prime-router/src/main/kotlin/azure/EmailSenderFunction.kt +++ b/prime-router/src/main/kotlin/azure/EmailSenderFunction.kt @@ -1,5 +1,6 @@ package gov.cdc.prime.router.azure +import com.fasterxml.jackson.databind.exc.MismatchedInputException import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import com.microsoft.azure.functions.ExecutionContext import com.microsoft.azure.functions.HttpMethod @@ -126,7 +127,7 @@ class EmailSenderFunction { private fun parseBody(requestBody: String, logger: Logger): TosAgreementForm? { return try { jacksonObjectMapper().readValue(requestBody, TosAgreementForm::class.java) - } catch (ex: Exception) { + } catch (ex: MismatchedInputException) { logger.info("There was an exception thrown when parsing your JSON") null }