Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to generate valid code for array of enums #41

Open
bemnetmerha-db opened this issue Apr 21, 2022 · 1 comment
Open

Unable to generate valid code for array of enums #41

bemnetmerha-db opened this issue Apr 21, 2022 · 1 comment

Comments

@bemnetmerha-db
Copy link

Using this plugin version, I am not able to generate valid array of enums.

addSbtPlugin(dependency =
  "org.openapitools" % "sbt-openapi-generator" % "5.0.1"
)
  1. Create api spec with this
        object_permissions:
          type: array
          description: Required list of Object ACLs
          items:
            type: string
            enum:
              - Test1
              - Test2
  1. run code gen using sbt openApiGenerate and config
openApiHttpUserAgent: "databricks-test"
generatorName: "scala-akka"
outputDir : "generated"
openApiGenerateApiTests: "true"
modelPropertyNaming: "original"
openApiGenerateApiDocumentation: "true"
openApiGenerateModelDocumentation: "true"
  1. Generated invalid code with no enum values.
  /* Required list of Object ACLs */
  object_permissions: Option[PartnerConfigEnums.Seq[ObjectPermissions]] = None,
) extends ApiModel

object PartnerConfigEnums {
  type Seq[ObjectPermissions] = Seq[ObjectPermissions].Value
  object Seq[ObjectPermissions] extends Enumeration {
  }
}
@nmiodice
Copy link

Did you ever find a workaround? I am also seeing this behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants