-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tutorial-5] Added an example of completing a future of unit for @ktoso
- Loading branch information
1 parent
79a48a5
commit e0cc6c6
Showing
2 changed files
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -6,6 +6,8 @@ import com.danielasfregola.quiz.management.entities.{Question, QuestionUpdate} | ||
import com.danielasfregola.quiz.management.routing.MyResource | import com.danielasfregola.quiz.management.routing.MyResource | ||
import com.danielasfregola.quiz.management.services.QuestionService | import com.danielasfregola.quiz.management.services.QuestionService | ||
|
|
||
import scala.concurrent.Future | |||
|
|||
trait QuestionResource extends MyResource { | trait QuestionResource extends MyResource { | ||
|
|
||
val questionService: QuestionService | val questionService: QuestionService | ||
|
@@ -30,7 +32,8 @@ trait QuestionResource extends MyResource { | ||
} | } | ||
} ~ | } ~ | ||
delete { | delete { | ||
complete(questionService.deleteQuestion(id)) | complete(Future(())) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
DanielaSfregola
Author
Owner
|
|||
// complete(questionService.deleteQuestion(id)) | |||
} | } | ||
} | } | ||
|
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Now I see why this renders for you. It's not an Akka HTTP thing though, it's how Heiko's library provides marshallers, this one triggers:
from
de.heikoseeberger.akkahttpjson4s.Json4sSupport
. So it's a 3rd party lib that makes the()
render as you noticed, not any Akka HTTP defaults. If possible it would be great if you could amend the blog post to explain that :-) Our defaults certainly don't provide default marshallers for this case yet it sounds so from the context of your blog post :)