Skip to content

[Bug]: OpenAPI to TypeSpec conversion of arrays of inline enums lead to invalid TypeSpec #8155

@baywet

Description

@baywet

Describe the bug

Using the conversion tool, inline enums for an array are not converted properly. I'd expected an enum definition, either inline definition, or as a separate type.

Reproduction

The following component schema

    ChatCompletionModalities:
      type: array
      items:
        type: string
        enum:
          - text
          - audio

leads to the following TypeSpec

union ChatCompletionModalities {
null,
}

Which missing the enum values

tool version 1.3.0

Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi3:converterIssues for @typespec/openapi3 openapi to typespec convertertriaged:core

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions