JSON'a özel nesnelerin listelerini sıralamak için spray-json kullanıyorum. Aşağıdaki vaka sınıfına ve JsonProtocol'una sahibim.spray-json ve liste sıralaması
case class ElementResponse(name: String, symbol: String, code: String, pkwiu: String, remarks: String, priceNetto: BigDecimal, priceBrutto: BigDecimal, vat: Int, minInStock:Int, maxInStock: Int)
object JollyJsonProtocol extends DefaultJsonProtocol with SprayJsonSupport {
implicit val elementFormat = jsonFormat10(ElementResponse)
}
bunun gibi bir rotada koymak deneyin:
could not find implicit value for evidence parameter of type spray.httpx.marshalling.Marshaller[List[pl.ftang.scala.polka.rest.ElementResponse]]
Belki sorun ne biliyor:
get {
complete {
List(new ElementResponse(...), new ElementResponse(...))
}
}
Ben söyleyerek bir hata alıyorum?
Ben sprey 1.1-M7 ve sprey json ile Scala 2.10.1 kullanıyorum 1.2.5
Bkz. [Bu örnek] (https://github.com/spray/spray/blob/master/examples/spray-client/simple-spray-client/src/main/scala/spray/examples/Main.scala), bir '' '' '' kullanır. – opyate