0

json4s version 4.0.3

scala version 3.1.0

jdk version 1.8.0_181

Does everyone else get warnings like this? Is there a way to suppress or work around them?

[warn] -- Deprecation Warning: ...\serialization\json\JSONSerializer.scala:76:51
[warn] 76 |    val graphs = (json \ "graphs").extract[JObject].obj.map { case (key, json) =>
[warn]    |                                                   ^
[warn]    |Compiler synthesis of Manifest and OptManifest is deprecated, instead
[warn]    |replace with the type `scala.reflect.ClassTag[org.json4s.JObject]`.
[warn]    |Alternatively, consider using the new metaprogramming features of Scala 3,
[warn]    |see https://docs.scala-lang.org/scala3/reference/metaprogramming.html

1 Answers1

0

Deprecations are a part of library development and warnings are for the interested parties to either use older versions or make adjustments accordingly.

As for Scala, a year ago, Scala 2.13.2 introduced a compiler flag, -Wconf, to configure error/warning levels along with many in-code annotations to use. please visit configuring-and-suppressing-warnings for details and more.

In your case, you may simply use the -Wconf:cat=deprecation:ss (ss for silent-summary) where you will get only the total number of deprecation warnings at the end of the process.

Yılmaz Durmaz
  • 2,374
  • 12
  • 26
  • Thanks. I had been using :ws for warning-summary as described on the page you reference, but it is not valid for Scala 3. Unfortunately, neither is the :ss that you suggest. [warn] Failed to parse `-Wconf` configuration: cat=deprecation:ss [warn] unknown action: `ss` – Keith Alcock Jan 19 '22 at 16:19
  • @KeithAlcock I had in mind "don't show anything other than in summary" and seems it won't work that way. have you tried a single `i` to ignore them or `s` flag to silence these messages? I think you won't see any deprecation messages with them, so keep that in mind for security concerns. – Yılmaz Durmaz Jan 19 '22 at 19:38
  • @KeithAlcock, alright, I was not prepared enough to see that many languages/frameworks did breaking changes in 2021, and compatibility issues flying all around. I have check their [compiler migration compatibility](https://docs.scala-lang.org/scala3/guides/migration/options-lookup.html) post and they are yet to implement many flags, and not clear if they will. please check the same migration guide or revert to a 2.x version if you are in trial-error phase – Yılmaz Durmaz Jan 19 '22 at 19:47