guardrail-dev / guardrail-dev/guardrail
Deprecated akka-http stuff
- Dominant language
- Scala
- Stars
- 541
- Forks
- 138
- PR merge metrics
- No merged PRs in 30d
Description
Bumping a test repo to akka-actor/akka-stream 2.6.0 and akka-http 10.1.12 yielded the following deprecated notices:
```
[warn] .../src/main/scala/App.scala:8:20: class ActorMaterializer in package stream is deprecated (since 2.6.0): The Materializer now has all methods the ActorMaterializer used to have
[warn] var actorSystem: Option[(akka.actor.ActorSystem, akka.stream.ActorMaterializer)] = None
[warn] ^
[warn] .../src/main/scala/App.scala:11:25: class ActorMaterializer in package stream is deprecated (since 2.6.0): The Materializer now has all methods the ActorMaterializer used to have
[warn] def getActorSystem(): (akka.actor.ActorSystem, akka.stream.ActorMaterializer) = {
[warn] ^
[warn] .../src/main/scala/App.scala:14:29: method apply in object ActorMaterializer is deprecated (since 2.6.0): Use the system wide materializer with stream attributes or configuration settings to change defaults
[warn] val mat = akka.stream.ActorMaterializer()
[warn] ^
[warn] .../src/main/scala/App.scala:21:47: class ActorMaterializer in package stream is deprecated (since 2.6.0): The Materializer now has all methods the ActorMaterializer used to have
[warn] implicit def localMaterializer: akka.stream.ActorMaterializer = getActorSystem()._2
[warn] ^
[warn] .../src/main/scala/nullability/nullability/pet/Routes.scala:44:33: value status in class IOResult is deprecated (since 2.6.0): status is always set to Success(Done)
[warn] case IOResult(_, Success(_)) =>
[warn] ^
[warn] .../src/main/scala/nullability/nullability/pet/Routes.scala:47:33: value status in class IOResult is deprecated (since 2.6.0): status is always set to Success(Done)
[warn] case IOResult(_, Failure(t)) =>
[warn] ^
[warn] .../src/main/scala/nullability/nullability/pet/Routes.scala:147:42: value RequestEntityTooLarge in object StatusCodes is deprecated (since 10.1.11): deprecated in favor of PayloadTooLarge
[warn] val status = StatusCodes.RequestEntityTooLarge
[warn] ^
[warn] 7 warnings found
```
This'll likely create problems at some point in the future, but fortunately the deprecation notices are very clear about what needs to change.
What likely needs to happen is to pop out an explicit `akka-http` version, similar to [circe-java8](https://github.com/twilio/guardrail/blob/9127232f337a358df9d0d19bae9290dac321d66d/modules/codegen/src/main/scala/com/twilio/guardrail/generators/ScalaModule.scala#L81), that just swap these accessors and types, since there's nothing particularly pressing in this change, it seems like a usability improvement over anything else.
Creating this issue so it doesn't get lost, but if nobody is interested in resolving this by the time the akka team deletes the deprecated accessors, I'll take care of it.
Contributor guide
Assessment
This issue has not been assessed yet.