diff --git a/router-protobuf/build.gradle.kts b/router-protobuf/build.gradle.kts index 8b187b8..b43c9bb 100644 --- a/router-protobuf/build.gradle.kts +++ b/router-protobuf/build.gradle.kts @@ -14,8 +14,8 @@ dependencies { implementation(kotlin("reflect")) implementation("org.slf4j:slf4j-api:2.0.13") - api("com.google.protobuf:protobuf-java:4.27.0") - api("com.google.protobuf:protobuf-java-util:4.27.0") + api("com.google.protobuf:protobuf-java:4.27.2") + api("com.google.protobuf:protobuf-java-util:4.27.2") implementation("com.google.guava:guava:33.2.1-jre") api(project(":router")) @@ -31,6 +31,6 @@ dependencies { protobuf { protoc { // The artifact spec for the Protobuf Compiler - artifact = "com.google.protobuf:protoc:4.27.0" + artifact = "com.google.protobuf:protoc:4.27.2" } } diff --git a/router-protobuf/src/main/kotlin/io/moia/router/proto/ProtoBufUtils.kt b/router-protobuf/src/main/kotlin/io/moia/router/proto/ProtoBufUtils.kt index e07ecf6..beafb8e 100644 --- a/router-protobuf/src/main/kotlin/io/moia/router/proto/ProtoBufUtils.kt +++ b/router-protobuf/src/main/kotlin/io/moia/router/proto/ProtoBufUtils.kt @@ -4,12 +4,12 @@ import com.fasterxml.jackson.databind.JsonNode import com.fasterxml.jackson.databind.node.ArrayNode import com.fasterxml.jackson.databind.node.ObjectNode import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper -import com.google.protobuf.GeneratedMessageV3 +import com.google.protobuf.GeneratedMessage import com.google.protobuf.util.JsonFormat object ProtoBufUtils { - fun toJsonWithoutWrappers(proto: GeneratedMessageV3): String { - val message = JsonFormat.printer().omittingInsignificantWhitespace().includingDefaultValueFields().print(proto) + fun toJsonWithoutWrappers(proto: GeneratedMessage): String { + val message = JsonFormat.printer().omittingInsignificantWhitespace().alwaysPrintFieldsWithNoPresence().print(proto) return removeWrapperObjects(message) }