Skip to content

[BUG] [scala-pekko] Array of enums fails to generate valid code #23399

@kkoskenvirta

Description

@kkoskenvirta
Description

72e942f fix was applied for sttp generator. Same problem still occures with scala-pekko.

Tried with all the recent versions and 3.0.4, same issue occures

OpenAPI declaration file content or url
type: object
required:
  - id
properties:
  id:
    type: string
    format: uuid
  categoryKey:
    type: string
  templateKey:
    type: string
  stateFilters:
    type: array
    items:
      type: string
      enum:
        - state_new
        - state_pending
        - state_approved
        - state_rejected
        - state_archived

This generates invalid class where with typing

case class ConditionalActionGenericForIssue (
  id: UUID,
  categoryKey: Option[String] = None,
  templateKey: Option[String] = None,
  stateFilters: Option[ConditionalActionGenericForIssueEnums.Seq[StateFilters]] = None
) extends ApiModel

object ConditionalActionGenericForIssueEnums {

  type Seq[StateFilters] = Seq[StateFilters].Value

  object Seq[StateFilters] extends Enumeration {
  }

}

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