New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
throw ISE when gRPC HTTP JSON transcoding is enabled but serialization format JSON is missing #5224
throw ISE when gRPC HTTP JSON transcoding is enabled but serialization format JSON is missing #5224
Conversation
…mat JSON is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
Please fix the lint error as well. 😎
Error: eckstyle] [ERROR] /home/ec2-user/actions-runner/_work/armeria/armeria/grpc/src/main/java/com/linecorp/armeria/server/grpc/GrpcServiceBuilder.java:982:13: '&&' should be on the previous line. [OperatorWrap]
* <p>Limitations: | ||
* <p><b>Limitations:</b> | ||
* Make sure {@code GrpcSerializationFormats.JSON} is supported by the service by calling | ||
* {@code this#supportedSerializationFormats(GrpcSerializationFormats.JSON)}. Otherwise, service builder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding this sentence at last instead of containing it in this section?
* <p>{@link GrpcSerializationFormats#JSON} must be supported via
* {@link #supportedSerializationFormats(SerializationFormat...)} to enable HTTP/JSON transcoding.
Oops, did not realize that because build scans looked good 😓 Double checked with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Dogacel 👍 🙇 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Dogacel! 🙇♂️
@@ -651,6 +651,10 @@ public GrpcServiceBuilder unframedGrpcErrorHandler(UnframedGrpcErrorHandler unfr | |||
* </li> | |||
* </ul> | |||
* | |||
* <p>{@link GrpcSerializationFormats#JSON} must be supported via | |||
* {@link #supportedSerializationFormats(SerializationFormat...)} to enable HTTP/JSON transcoding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence sounds like users must always set GrpcSerializationFormats#JSON
but they don't need it when using the default GrpcSerializationFormats
which is all GrpcSerializationFormats#values()
.
How about?
When custom {@link #supportedSerializationFormats(SerializationFormat...)} are used,
{@link GrpcSerializationFormats#JSON} must be included to enable HTTP/JSON transcoding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated 👍
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5224 +/- ##
============================================
- Coverage 74.21% 74.08% -0.13%
- Complexity 19858 19964 +106
============================================
Files 1705 1715 +10
Lines 73185 73557 +372
Branches 9357 9365 +8
============================================
+ Hits 54311 54494 +183
- Misses 14436 14633 +197
+ Partials 4438 4430 -8
☔ View full report in Codecov by Sentry. |
Motivation:
Explain why you're making this change and what problem you're trying to solve.
Modifications:
GrpcServiceBuilder.build()
if transcoding is enabled but serialization formatJSON
is not set.Result:
The detailed description on why this is an annoying issue is discussed in the issue.