fjaros / dropwizard-scala

Scala helpers for Dropwizard.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dropwizard-Scala

A fork of the original (now unmaintained) dropwizard-scala subproject of Dropwizard.

Build Status


SBT information:

libraryDependencies += "com.massrelevance" %% "dropwizard-scala" % "0.7.1"

Dropwizard services should extend ScalaApplication instead of Application and add ScalaBundle:

    object ExampleService extends ScalaApplication[ExampleConfiguration]) {
      override def getName = "example"

      def initialize(bootstrap: Bootstrap[ExampleConfiguration]) {
        bootstrap.addBundle(new ScalaBundle)
      }

      def run(configuration: ExampleConfiguration, environment: Environment) {
        env.jersey().register(new ExampleResource)
      }
    }

Features

dropwizard-scala provides the following:

  • QueryParam-annotated parameters of type Seq[String], List[String], Vector[String], IndexedSeq[String], Set[String], and Option[String].
  • Case class (i.e., Product instances) JSON request and response entities.
  • Array[A] request and response entities. (Due to the JVM's type erasure and mismatches between Scala and Java type signatures, this is the only "generic" class supported since Array type parameters are reified.)

About

Scala helpers for Dropwizard.

License:Apache License 2.0


Languages

Language:Scala 100.0%