OpenAPITools / OpenAPITools/openapi-generator

[Scala-Akka-Http] `ActorMaterializer` is deprecated

Open
#11,047 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description
openapi-generator version

5.3.0

OpenAPI declaration file content or url

Any

Command line used for generation
Steps to reproduce
  1. Generate any open api spec with the Scala Akka HTTP client generator
  2. Notice that the ApiInvoker.scala uses the deprecated ActorMaterializer that has been deprecated since akka-http 2.6.0.
ApiInvoker.scala:94:58
[E]      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
[E]      L94:   private implicit val materializer: ActorMaterializer = ActorMaterializer()
ApiInvoker.scala:94:38
[E]      class ActorMaterializer in package stream is deprecated (since 2.6.0): The Materializer now has all methods the ActorMaterializer used to have
[E]      L94:   private implicit val materializer: ActorMaterializer = ActorMaterializer()
Related issues/PRs
Suggest a fix/enhancement

We should change the invoker template to use Materializer(system)

https://github.com/OpenAPITools/openapi-generator/blob/5a62ae6628fb30d2fd61c42c8d1961614ea757f1/modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache#L84

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache around line 84 and inspect how the Scala Akka HTTP client creates its materializer. Generate a client from any OpenAPI specification and verify that ApiInvoker.scala uses Materializer(system) without the reported ActorMaterializer deprecation warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.