Skip to content

[Java] Missing import of class OrderEnum when using nested Array in spec.  #7918

@msjoshi

Description

@msjoshi
Description

In our API spec, I have a nested array with enums as one of the attribute. When I use the default command to generate Java client, it looks like there is a missing import for OrderEnum class and get the following error during compile.

I searched the issues and did find similar issues but none related to OrderEnum. Really appreciate if anyone can guide me in the right direction.

cannot find symbol symbol: class OrderEnum location: class io.swagger.client.model.NotificationSearch

Swagger-codegen version

2.3.1

Swagger declaration file content or url
"order": {
          "description": "A collection of grouped attribute names and directions.",
          "type": "array",
          "items": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "id",
                "tagId",
                "position",
                "roomNumber",
                "floorNumber",
                "alarmThreshold",
                "adjustedVariance",
                "location",
                "caliberType",
                "caliberConfidence",
                "realTimeClock",
                "createdAt",
                "updatedAt",
                "deletedAt",
                "ASC",
                "DESC"
              ]
            }
          }
        }
Command line used for generation

java -jar "/Users/mjoshi/projects/papi/app/src/scripts/lib/swagger/codegen/2.3.1/swagger-codegen-cli.jar" generate -i /Users/mjoshi/projects/papi/app/src/swagger/api.json -l java -c /Users/mjoshi/projects/papi/app/src/swagger/clients/papi-client-java/.swagger-codegen/config.json -o /Users/mjoshi/projects/papi/app/src/swagger/clients/papi-client-java 2>&1

Please note config.json is empty.

Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions