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
Provides Empty Message #75
Conversation
Codecov Report
@@ Coverage Diff @@
## master #75 +/- ##
=======================================
Coverage 88.52% 88.52%
=======================================
Files 12 12
Lines 122 122
=======================================
Hits 108 108
Misses 14 14 Continue to review full report at Codecov.
|
fda7bd1
to
7c24330
Compare
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 good
@@ -38,6 +38,9 @@ package object protocol { | |||
class message extends StaticAnnotation | |||
|
|||
class option(val name: String, val value: String, val quote: Boolean) extends StaticAnnotation | |||
|
|||
@message | |||
case class Empty() |
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.
can this be an object Empty
instead?
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.
I'm afraid it cannot be. We need a valid type (serializable) that we could use as request/response type.
As Protobuf provides Emtpy, this PR provides an empty type:
freestyle.rpc.protocol.Empty
as generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method.For instance:
Fixes #63