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
I want to convert a JsValue to Double. Code is here: action.annotations.get("average_cpu").getOrElse(JsNumber(0)).convertTo[Double],
Don't care about the logic, I get a Option[JsValue] here and use getOrElse method to get JsValue type. Then I want to convert to Double, but the IDE kept telling me an error:No implicit arguments of type: JsonReader[Double]
And when I built my project, there was an error: Cannot find JsonReader or JsonFormat type class for Double action.annotations.get("average_cpu").getOrElse(JsNumber(0)).convertTo[Double],
How to solve it ?
The text was updated successfully, but these errors were encountered:
Let me tell you that this is absolutely not the way to open an issue. You are not showing any complete code snippet that may be reproducible by anybody else. You're saying "the IDE" without even saying which IDE is. You haven't built a minimal reproducible example of how this supposed bug may be reproducible.
That said, try import spray.json.DefaultJsonProtocol._
I want to convert a JsValue to Double. Code is here:
action.annotations.get("average_cpu").getOrElse(JsNumber(0)).convertTo[Double],
Don't care about the logic, I get a Option[JsValue] here and use getOrElse method to get JsValue type. Then I want to convert to Double, but the IDE kept telling me an error:
No implicit arguments of type: JsonReader[Double]
And when I built my project, there was an error:
Cannot find JsonReader or JsonFormat type class for Double action.annotations.get("average_cpu").getOrElse(JsNumber(0)).convertTo[Double],
How to solve it ?
The text was updated successfully, but these errors were encountered: