You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 21, 2018. It is now read-only.
Was doing some json-based storage for a little project and found that this innocent code:
object JsonBufferError extends App {
import rapture.json._
import jsonBackends.jawn._
JsonBuffer.parse("""{"counter": 1}""").as[Json].counter.as[Long] // <-- this line works ok
JsonBuffer.parse("""{"counter": 1}""").counter.as[Long] // <-- this line fails
}
Exception being:
Exception in thread "main" rapture.data.TypeMismatchException: type mismatch: Expected number but found object
at rapture.json.jsonBackends.jawn.JawnAst$.getBigDecimal(ast.scala:68)
at rapture.json.Extractors_1$$anon$6$$anonfun$extract$6.apply(extractors.scala:100)
at rapture.json.Extractors_1$$anon$6$$anonfun$extract$6.apply(extractors.scala:100)
at rapture.core.ThrowExceptionsMode.wrap(modes.scala:200)
at rapture.json.Extractors_1$$anon$6.extract(extractors.scala:100)
at rapture.json.Extractors_1$$anon$6.extract(extractors.scala:95)
at rapture.data.Extractor$$anon$7$$anonfun$extract$7$$anonfun$apply$8.apply(extractors.scala:140)
at rapture.core.ThrowExceptionsMode.unwrap(modes.scala:201)
at rapture.data.Extractor$$anon$7$$anonfun$extract$7.apply(extractors.scala:140)
at rapture.core.ThrowExceptionsMode.wrap(modes.scala:200)
at rapture.data.Extractor$$anon$7.extract(extractors.scala:140)
at rapture.data.Extractor$$anon$7$$anonfun$extract$7$$anonfun$apply$8.apply(extractors.scala:140)
at rapture.core.ThrowExceptionsMode.unwrap(modes.scala:201)
at rapture.data.Extractor$$anon$7$$anonfun$extract$7.apply(extractors.scala:140)
at rapture.core.ThrowExceptionsMode.wrap(modes.scala:200)
at rapture.data.Extractor$$anon$7.extract(extractors.scala:140)
at rapture.json.Extractors_2$$anon$7.extract(extractors.scala:124)
at rapture.json.Extractors_2$$anon$7.extract(extractors.scala:121)
at rapture.data.DataType$class.as(data.scala:256)
at rapture.json.JsonBuffer.as(json.scala:177)
at JsonBufferError$.delayedEndpoint$JsonBufferError$1(JsonBufferError.scala:5)
at JsonBufferError$delayedInit$body.apply(JsonBufferError.scala:1)
at scala.Function0$class.apply$mcV$sp(Function0.scala:34)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.App$$anonfun$main$1.apply(App.scala:76)
at scala.collection.immutable.List.foreach(List.scala:381)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:35)
at scala.App$class.main(App.scala:76)
at JsonBufferError$.main(JsonBufferError.scala:1)
at JsonBufferError.main(JsonBufferError.scala)
...
The text was updated successfully, but these errors were encountered:
Rapture 2.0.0-M7, Scala 2.11.8
Was doing some json-based storage for a little project and found that this innocent code:
Exception being:
The text was updated successfully, but these errors were encountered: