Created
February 18, 2019 12:50
-
-
Save adamw/c107e5bcff8e4baae24f51a23a7eaf29 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
val bookBody = jsonBody[Book] | |
.description("The book") | |
.example(Book("Pride and Prejudice", "Novel", 1813)) | |
val addBook: Endpoint[(Book, String), Unit, Boolean, Nothing] = | |
endpoint | |
.description("Adds a new book, if the user is authorized") | |
.post | |
.in("book" / "add") | |
.in(bookBody) | |
.in(header[String]("X-Auth-Token") | |
.description("The token is 'secret'")) | |
.out(plainBody[Boolean]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment