Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No implicit arguments of type: JsonReader[Double] #347

Closed
JesseStutler opened this issue Mar 2, 2022 · 1 comment
Closed

No implicit arguments of type: JsonReader[Double] #347

JesseStutler opened this issue Mar 2, 2022 · 1 comment

Comments

@JesseStutler
Copy link

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 ?

@TonioGela
Copy link

The format is here.

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._

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants