scalatra.queryParamOperation.mustache Maven / Gradle / Ivy
{{#collectionFormat}}val {{paramName}}String = params.getAs[String]("{{paramName}}")
val {{paramName}} = if("{{collectionFormat}}" == "default" || "{{collectionFormat}}" == "csv") {
{{paramName}}String match {
case Some(str) => str.split(",").toSeq
case None => Seq()
}
} else
Seq()
{{/collectionFormat}}
{{^collectionFormat}}
val {{paramName}} = params.getAs[{{dataType}}]("{{paramName}}")
{{/collectionFormat}}