From f5f8f1c0360ad8c59e18560bd5883833bdeb1422 Mon Sep 17 00:00:00 2001 From: halo Date: Wed, 10 Jun 2026 08:38:16 +0900 Subject: [PATCH] docs: document required dependencies for JsonToGrpc filter (GH-3424) The JsonToGrpc filter depends on several optional libraries (jackson-dataformat-protobuf, grpc-netty, grpc-protobuf, grpc-stub, protobuf-java-util) that must be added explicitly. Without them, a NoClassDefFoundError is thrown at runtime when a request hits the route. Added a "Required Dependencies" section with Maven and Gradle examples. Closes gh-3424 Co-Authored-By: Claude Sonnet 4.6 --- .../jsontogrpc-factory.adoc | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/docs/modules/ROOT/pages/spring-cloud-gateway-server-webflux/gatewayfilter-factories/jsontogrpc-factory.adoc b/docs/modules/ROOT/pages/spring-cloud-gateway-server-webflux/gatewayfilter-factories/jsontogrpc-factory.adoc index b5ce622e1..229bb8a89 100644 --- a/docs/modules/ROOT/pages/spring-cloud-gateway-server-webflux/gatewayfilter-factories/jsontogrpc-factory.adoc +++ b/docs/modules/ROOT/pages/spring-cloud-gateway-server-webflux/gatewayfilter-factories/jsontogrpc-factory.adoc @@ -3,6 +3,53 @@ The JSONToGRPC GatewayFilter Factory converts a JSON payload to a gRPC request. +[[jsontogrpc-dependencies]] +== Required Dependencies + +The `JsonToGrpc` filter depends on several optional libraries that are *not* included by default. +You must add them explicitly to your project: + +.Maven +[source,xml] +---- + + tools.jackson.dataformat + jackson-dataformat-protobuf + + + io.grpc + grpc-netty + + + io.grpc + grpc-protobuf + + + io.grpc + grpc-stub + + + com.google.protobuf + protobuf-java-util + +---- + +.Gradle +[source,groovy] +---- +implementation 'tools.jackson.dataformat:jackson-dataformat-protobuf' +implementation 'io.grpc:grpc-netty' +implementation 'io.grpc:grpc-protobuf' +implementation 'io.grpc:grpc-stub' +implementation 'com.google.protobuf:protobuf-java-util' +---- + +[WARNING] +==== +If any of these dependencies are missing you will see a `NoClassDefFoundError` at runtime (for example, `com/fasterxml/jackson/dataformat/protobuf/ProtobufFactory`) when a request hits the route. +The versions are managed by the Spring Cloud Gateway BOM, so no version attributes are needed when using the BOM. +==== + The filter takes the following arguments: * `service`: Short name of the service that handles the request.