Merge pull request #19118 from Softwire/wip-18567-unmarshallers-for-csv-number-sequences
!htp #18567 Added unmarshallers for CSV integer sequences
This commit is contained in:
commit
0f74a0e02b
3 changed files with 82 additions and 22 deletions
6
akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/ParameterDirectivesSpec.scala
Normal file → Executable file
6
akka-http-tests/src/test/scala/akka/http/scaladsl/server/directives/ParameterDirectivesSpec.scala
Normal file → Executable file
|
|
@ -7,7 +7,7 @@ package directives
|
|||
|
||||
import org.scalatest.{ FreeSpec, Inside }
|
||||
import akka.http.scaladsl.unmarshalling.Unmarshaller.HexInt
|
||||
import akka.http.scaladsl.unmarshalling.Unmarshaller.CsvString
|
||||
import akka.http.scaladsl.unmarshalling.Unmarshaller.CsvStringSeq
|
||||
|
||||
class ParameterDirectivesSpec extends FreeSpec with GenericRoutingSpec with Inside {
|
||||
"when used with 'as[Int]' the parameter directive should" - {
|
||||
|
|
@ -53,9 +53,9 @@ class ParameterDirectivesSpec extends FreeSpec with GenericRoutingSpec with Insi
|
|||
}
|
||||
}
|
||||
|
||||
"when used with 'as(CsvString)' the parameter directive should" - {
|
||||
"when used with 'as(CsvStringSeq)' the parameter directive should" - {
|
||||
val route =
|
||||
parameter("names".as(CsvString)) { names ⇒
|
||||
parameter("names".as(CsvStringSeq)) { names ⇒
|
||||
complete(s"The parameters are ${names.mkString(", ")}")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue