Skip to content
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

Merged
merged 1 commit into from Nov 6, 2017
Merged

Conversation

juanpedromoreno
Copy link
Member

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:

@free
@service
trait Foo {      
  @rpc def Bar(empty: Empty): FS[Empty]      
}

Fixes #63

@codecov-io
Copy link

codecov-io commented Nov 6, 2017

Codecov Report

Merging #75 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6798fb5...7c24330. Read the comment docs.

Copy link
Contributor

@fedefernandez fedefernandez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@juanpedromoreno juanpedromoreno merged commit 1732ce4 into master Nov 6, 2017
@juanpedromoreno juanpedromoreno deleted the feature/frpc-63-empty-requests branch November 6, 2017 14:13
@@ -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()
Copy link
Contributor

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?

Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants