Skip to content

Instantly share code, notes, and snippets.

@adamw
Created May 4, 2019 12:17
Show Gist options
  • Save adamw/dd556c41263e4c80439bcf29d06c47a8 to your computer and use it in GitHub Desktop.
Save adamw/dd556c41263e4c80439bcf29d06c47a8 to your computer and use it in GitHub Desktop.
import io.circe.generic.auto._
import tapir._
import tapir.json.circe._
import tapir.model.StatusCode
val getBooks = endpoint.get
.in("api" / "v1.0" / "books")
.in(query[Option[Year]]("year"))
.in(query[Option[Int]]("limit"))
.errorOut(statusCode)
.errorOut(jsonBody[ErrorInfo]))
.out(jsonBody[List[Book]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment