Skip to content

Commit

Permalink
migrate to v4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Steinke committed Jul 4, 2024
1 parent 31bceee commit 9b6a927
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions router-protobuf/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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"))

Expand All @@ -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"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 9b6a927

Please sign in to comment.