Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #5581
Closed
Open
Issue created Mar 11, 2020 by Administrator@rootContributor5 of 6 checklist items completed5/6 checklist items

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

Created by: 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: https://github.com/OpenAPITools/openapi-generator/issues/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.

Assignee
Assign to
Time tracking