Skip to content

Instantly share code, notes, and snippets.

@kciesielski
Last active December 15, 2015 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kciesielski/26a79cc34daa49e038be to your computer and use it in GitHub Desktop.
Save kciesielski/26a79cc34daa49e038be to your computer and use it in GitHub Desktop.
Simple Scalatra GET handler
class ExampleServlet(val swagger: Swagger) extends ScalatraServlet
with ExampleServletSwaggerDefinition with JacksonJsonSupport with JValueResult {
//...
get("/", operation(getOperation)) {
val itemType = params("type")
ExampleItemList(List(
ExampleItem("1", "item1", itemType, new Date()),
ExampleItem("2", "item2", itemType, new Date())
))
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment