Skip to content

[BUG][SCALA] Name conflict between Scala Any and generated Any #5581

Open
@crenshaw-dev

Description

@crenshaw-dev

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • What's the version of OpenAPI Generator used?
  • Have you search for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Bounty to sponsor the fix (example)
Description

Generating a scala-akka client for Argo Workflows, I encounter a couple issues.

The first I've already reported here: #5580

After replacing all three instances of ByteArray with Array[Byte], I try mvn clean install again.

I get the following error:

[ERROR] /home/.../src/argo-client-scala/src/main/scala/org/openapitools/client/api/EnumsSerializers.scala:44: error: overriding method serialize in trait Serializer of type (implicit format: org.json4s.Formats)PartialFunction[Any,org.json4s.JValue];
[ERROR]  method serialize has incompatible type
[ERROR]     def serialize(implicit format: Formats): PartialFunction[Any, JValue] = {

This happens because Any in EnumsSerializers.scala refers to the generated org.openapitools.client.model.Any. If I change the name of that case class to ArgoAny and update all references besides the one in EnumsSerializers.scala, the build error goes away.

openapi-generator version

4.3.0-SNAPSHOT

OpenAPI declaration file content or url

https://raw.githubusercontent.com/argoproj/argo/20d6e27bdf11389f23b2efe1be4ef737f333221d/api/openapi-spec/swagger.json

Command line used for generation
java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/argoproj/argo/master/api/openapi-spec/swagger.json -g scala-akka -o ~/src/argo-client-scala --artifact-id argo-client-scala --artifact-version 0.1-SNAPSHOT --group-id com.crenshaw_dev -g scala-akka -o ~/src/argo-client-scala --artifact-id argo-client-scala --artifact-version 0.1-SNAPSHOT --group-id com.crenshaw_dev
Steps to reproduce
cd ~/src/argo-client-scala
mvn clean install
Related issues/PRs
Suggest a fix

Looks as if Any just isn't treated as a reserved keywork in scala-akka and should be. But I'm not certain.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions