Skip to content

Instantly share code, notes, and snippets.

@adamw
Last active May 18, 2020 08:29
Show Gist options
  • Save adamw/7e5103730eb5c64fa6e87f97c49d584e to your computer and use it in GitHub Desktop.
Save adamw/7e5103730eb5c64fa6e87f97c49d584e to your computer and use it in GitHub Desktop.
case class User(id: UUID, name: String)
case class Pet(id: UUID, kind: String, name: String)
val getPet: Endpoint[(AuthToken, UUID), Error, Pet, Nothing] =
baseEndpoint
.get
.in(query[UUID]("id").description("The id of the pet to find"))
.out(jsonBody[Pet])
.description("Finds a pet by id")
val addPet: Endpoint[(AuthToken, Pet), Error, Unit, Nothing] =
baseEndpoint
.post
.in(jsonBody[Pet])
.description("Adds a pet")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment